From ed3907547495aacd304b9936aa4dbe07e410ef32 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 27 Sep 2024 03:33:26 +0000 Subject: [PATCH] CodeGen from PR 30768 in Azure/azure-rest-api-specs Merge f857628ff2d7bfaaefb117ed52ddcd5f082fdad0 into 139840784c38414085b3d799cee5545f9b6e8dec --- .../RadiologyInsightsAsyncClient.java | 757 +-- .../RadiologyInsightsClient.java | 757 +-- .../RadiologyInsightsClientBuilder.java | 29 +- .../RadiologyInsightsServiceVersion.java | 6 +- .../RadiologyInsightsClientImpl.java | 4445 ++++++++++------- .../models/AgeMismatchInference.java | 71 +- .../models/ClinicalDocumentType.java | 2 - .../CompleteOrderDiscrepancyInference.java | 101 +- .../models/ContactPointSystem.java | 2 - .../models/ContactPointUse.java | 2 - .../models/CriticalResult.java | 57 +- .../models/CriticalResultInference.java | 87 +- .../DocumentAdministrativeMetadata.java | 53 +- .../models/DocumentAuthor.java | 49 +- .../models/DocumentContent.java | 56 +- .../models/DocumentContentSourceType.java | 2 - .../models/DocumentType.java | 2 - .../models/EncounterClass.java | 2 - .../models/FhirR4Annotation.java | 71 +- .../models/FhirR4CodeableConcept.java | 54 +- .../models/FhirR4Coding.java | 61 +- .../models/FhirR4Condition.java | 306 +- .../models/FhirR4ConditionStage.java | 49 +- .../models/FhirR4ContactDetail.java | 55 +- .../models/FhirR4ContactPoint.java | 61 +- .../models/FhirR4DomainResource.java | 200 +- .../models/FhirR4Element.java | 50 +- .../models/FhirR4Extension.java | 132 +- .../models/FhirR4Identifier.java | 69 +- .../radiologyinsights/models/FhirR4Meta.java | 68 +- .../models/FhirR4Narrative.java | 64 +- .../models/FhirR4Observation.java | 362 +- .../models/FhirR4ObservationComponent.java | 150 +- .../FhirR4ObservationReferenceRange.java | 68 +- .../models/FhirR4Period.java | 53 +- .../models/FhirR4Quantity.java | 65 +- .../radiologyinsights/models/FhirR4Range.java | 53 +- .../radiologyinsights/models/FhirR4Ratio.java | 53 +- .../models/FhirR4Reference.java | 61 +- .../models/FhirR4ResearchStudy.java | 318 +- .../models/FhirR4Resource.java | 91 +- .../models/FhirR4SampledData.java | 93 +- .../models/FindingInference.java | 83 +- .../models/FindingOptions.java | 46 +- .../FollowupCommunicationInference.java | 156 +- .../FollowupRecommendationInference.java | 164 +- .../models/FollowupRecommendationOptions.java | 58 +- .../GenericProcedureRecommendation.java | 94 +- .../models/ImagingProcedure.java | 75 +- .../ImagingProcedureRecommendation.java | 96 +- .../radiologyinsights/models/JobStatus.java | 2 - .../LateralityDiscrepancyInference.java | 96 +- .../models/LateralityDiscrepancyType.java | 2 - .../LimitedOrderDiscrepancyInference.java | 101 +- .../models/MedicalProfessionalType.java | 2 - .../models/ObservationStatusCodeType.java | 2 - .../models/OrderedProcedure.java | 54 +- .../models/PatientDetails.java | 56 +- .../models/PatientDocument.java | 158 +- .../models/PatientEncounter.java | 157 + .../models/PatientRecord.java | 136 +- .../radiologyinsights/models/PatientSex.java | 2 - .../models/ProcedureRecommendation.java | 121 +- .../models/RadiologyCodeWithTypes.java | 56 +- .../models/RadiologyInsightsData.java | 57 +- .../models/RadiologyInsightsInference.java | 130 +- .../RadiologyInsightsInferenceOptions.java | 51 +- .../RadiologyInsightsInferenceResult.java | 58 +- .../RadiologyInsightsInferenceType.java | 2 - .../models/RadiologyInsightsJob.java | 225 + .../RadiologyInsightsModelConfiguration.java | 69 +- .../RadiologyInsightsPatientResult.java | 56 +- .../models/RadiologyProcedureInference.java | 102 +- .../models/RecommendationFinding.java | 72 +- .../RecommendationFindingStatusType.java | 2 - .../models/ResearchStudyArm.java | 63 +- .../models/ResearchStudyObjective.java | 57 +- .../models/ResearchStudyStatusCodeType.java | 2 - .../models/SexMismatchInference.java | 83 +- .../models/SpecialtyType.java | 2 - .../radiologyinsights/models/TimePeriod.java | 55 +- .../src/main/java/module-info.java | 1 + ...-radiologyinsights_apiview_properties.json | 18 +- .../RadiologyInsightsClientTestBase.java | 43 + .../tsp-location.yaml | 9 +- 85 files changed, 8680 insertions(+), 3281 deletions(-) create mode 100644 sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientEncounter.java create mode 100644 sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsJob.java create mode 100644 sdk/healthinsights/azure-health-insights-radiologyinsights/src/test/java/com/azure/health/insights/radiologyinsights/generated/RadiologyInsightsClientTestBase.java diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java index bc4cd3dc1c76d..2874127d26709 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java @@ -15,9 +15,9 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.polling.PollerFlux; import com.azure.health.insights.radiologyinsights.implementation.RadiologyInsightsClientImpl; -import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsData; import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsInferenceResult; -import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsResult; +import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsJob; +import java.util.List; /** * Initializes a new instance of the asynchronous RadiologyInsightsClient type. @@ -42,224 +42,234 @@ public final class RadiologyInsightsAsyncClient { * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
+     *             locale: String (Optional)
      *         }
-     *         locale: String (Optional)
      *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
      *     id: String (Required)
      *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
      *     error (Optional): {
      *         code: String (Required)
      *         message: String (Required)
@@ -272,137 +282,291 @@ public final class RadiologyInsightsAsyncClient {
      *             innererror (Optional): (recursive schema, see innererror above)
      *         }
      *     }
-     *     result (Optional): {
-     *         patientResults (Required): [
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
      *              (Required){
-     *                 patientId: String (Required)
-     *                 inferences (Required): [
-     *                      (Required){
-     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
-     *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
      *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
+     *                                 security (Optional): [
+     *                                      (Optional){
      *                                         id: String (Optional)
      *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
+     *                                              (Optional){
+     *                                                 id: String (Optional)
+     *                                                 extension (Optional): [
+     *                                                     (recursive schema, see above)
+     *                                                 ]
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
      *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
      *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
      *                                     }
-     *                                     display: String (Optional)
-     *                                 }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
      *                             }
      *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
      *                     }
      *                 ]
      *             }
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of provides status details for long running operations. + * @return the {@link PollerFlux} for polling of response for the Radiology Insights request. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginInferRadiologyInsights(BinaryData radiologyInsightsData, + public PollerFlux beginInferRadiologyInsights(String id, BinaryData resource, RequestOptions requestOptions) { - return this.serviceClient.beginInferRadiologyInsightsAsync(radiologyInsightsData, requestOptions); + return this.serviceClient.beginInferRadiologyInsightsAsync(id, resource, requestOptions); + } + + /** + * Create Radiology Insights job + * + * Creates a Radiology Insights job with the given request body. + * + * @param id The unique ID of the job. + * @param resource The resource instance. + * @param expand Expand the indicated resources into the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response for the Radiology Insights request. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginInferRadiologyInsights(String id, + RadiologyInsightsJob resource, List expand) { + // Generated convenience method for beginInferRadiologyInsightsWithModel + RequestOptions requestOptions = new RequestOptions(); + if (expand != null) { + for (String paramItemValue : expand) { + if (paramItemValue != null) { + requestOptions.addQueryParam("expand", paramItemValue, false); + } + } + } + return serviceClient.beginInferRadiologyInsightsWithModelAsync(id, BinaryData.fromObject(resource), + requestOptions); } /** @@ -410,22 +574,23 @@ public PollerFlux beginInferRadiologyInsights(BinaryData * * Creates a Radiology Insights job with the given request body. * - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of provides status details for long running operations. + * @return the {@link PollerFlux} for polling of response for the Radiology Insights request. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux - beginInferRadiologyInsights(RadiologyInsightsData radiologyInsightsData) { + public PollerFlux beginInferRadiologyInsights(String id, + RadiologyInsightsJob resource) { // Generated convenience method for beginInferRadiologyInsightsWithModel RequestOptions requestOptions = new RequestOptions(); - return serviceClient.beginInferRadiologyInsightsWithModelAsync(BinaryData.fromObject(radiologyInsightsData), + return serviceClient.beginInferRadiologyInsightsWithModelAsync(id, BinaryData.fromObject(resource), requestOptions); } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java index 7de41efdfc193..dafcee67eab73 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java @@ -15,9 +15,9 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; import com.azure.health.insights.radiologyinsights.implementation.RadiologyInsightsClientImpl; -import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsData; import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsInferenceResult; -import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsResult; +import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsJob; +import java.util.List; /** * Initializes a new instance of the synchronous RadiologyInsightsClient type. @@ -42,224 +42,234 @@ public final class RadiologyInsightsClient { * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
+     *             locale: String (Optional)
      *         }
-     *         locale: String (Optional)
      *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
      *     id: String (Required)
      *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
      *     error (Optional): {
      *         code: String (Required)
      *         message: String (Required)
@@ -272,114 +282,217 @@ public final class RadiologyInsightsClient {
      *             innererror (Optional): (recursive schema, see innererror above)
      *         }
      *     }
-     *     result (Optional): {
-     *         patientResults (Required): [
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
      *              (Required){
-     *                 patientId: String (Required)
-     *                 inferences (Required): [
-     *                      (Required){
-     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
-     *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
      *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
+     *                                 security (Optional): [
+     *                                      (Optional){
      *                                         id: String (Optional)
      *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
+     *                                              (Optional){
+     *                                                 id: String (Optional)
+     *                                                 extension (Optional): [
+     *                                                     (recursive schema, see above)
+     *                                                 ]
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
      *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
      *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
      *                                     }
-     *                                     display: String (Optional)
-     *                                 }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
      *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
      *                         ]
      *                     }
      *                 ]
@@ -387,22 +500,72 @@ public final class RadiologyInsightsClient {
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of provides status details for long running operations. + * @return the {@link SyncPoller} for polling of response for the Radiology Insights request. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginInferRadiologyInsights(BinaryData radiologyInsightsData, + public SyncPoller beginInferRadiologyInsights(String id, BinaryData resource, RequestOptions requestOptions) { - return this.serviceClient.beginInferRadiologyInsights(radiologyInsightsData, requestOptions); + return this.serviceClient.beginInferRadiologyInsights(id, resource, requestOptions); + } + + /** + * Create Radiology Insights job + * + * Creates a Radiology Insights job with the given request body. + * + * @param id The unique ID of the job. + * @param resource The resource instance. + * @param expand Expand the indicated resources into the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for the Radiology Insights request. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginInferRadiologyInsights(String id, + RadiologyInsightsJob resource, List expand) { + // Generated convenience method for beginInferRadiologyInsightsWithModel + RequestOptions requestOptions = new RequestOptions(); + if (expand != null) { + for (String paramItemValue : expand) { + if (paramItemValue != null) { + requestOptions.addQueryParam("expand", paramItemValue, false); + } + } + } + return serviceClient.beginInferRadiologyInsightsWithModel(id, BinaryData.fromObject(resource), requestOptions); } /** @@ -410,22 +573,22 @@ public SyncPoller beginInferRadiologyInsights(BinaryData * * Creates a Radiology Insights job with the given request body. * - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of provides status details for long running operations. + * @return the {@link SyncPoller} for polling of response for the Radiology Insights request. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller - beginInferRadiologyInsights(RadiologyInsightsData radiologyInsightsData) { + public SyncPoller beginInferRadiologyInsights(String id, + RadiologyInsightsJob resource) { // Generated convenience method for beginInferRadiologyInsightsWithModel RequestOptions requestOptions = new RequestOptions(); - return serviceClient.beginInferRadiologyInsightsWithModel(BinaryData.fromObject(radiologyInsightsData), - requestOptions); + return serviceClient.beginInferRadiologyInsightsWithModel(id, BinaryData.fromObject(resource), requestOptions); } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java index b507f4259589e..0b40a3668614f 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java @@ -9,7 +9,9 @@ import com.azure.core.client.traits.EndpointTrait; import com.azure.core.client.traits.HttpTrait; import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; @@ -18,6 +20,7 @@ import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -43,8 +46,8 @@ * A builder for creating a new instance of the RadiologyInsightsClient type. */ @ServiceClientBuilder(serviceClients = { RadiologyInsightsClient.class, RadiologyInsightsAsyncClient.class }) -public final class RadiologyInsightsClientBuilder - implements HttpTrait, ConfigurationTrait, +public final class RadiologyInsightsClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, KeyCredentialTrait, EndpointTrait { @Generated @@ -288,6 +291,9 @@ private HttpPipeline createHttpPipeline() { if (keyCredential != null) { policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } this.pipelinePolicies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); @@ -328,4 +334,23 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public RadiologyInsightsClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsServiceVersion.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsServiceVersion.java index 04b44c9ae470c..5b2e2b4760ce5 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsServiceVersion.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsServiceVersion.java @@ -11,9 +11,9 @@ */ public enum RadiologyInsightsServiceVersion implements ServiceVersion { /** - * Enum value 2023-09-01-preview. + * Enum value 2024-04-01. */ - V2023_09_01_PREVIEW("2023-09-01-preview"); + V2024_04_01("2024-04-01"); private final String version; @@ -35,6 +35,6 @@ public String getVersion() { * @return The latest {@link RadiologyInsightsServiceVersion}. */ public static RadiologyInsightsServiceVersion getLatest() { - return V2023_09_01_PREVIEW; + return V2024_04_01; } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java index b1b46bfb3bdb2..00dfa2aa7723e 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java @@ -9,7 +9,8 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -19,7 +20,6 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.RetryPolicy; @@ -29,7 +29,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; -import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.PollingStrategyOptions; @@ -39,10 +38,8 @@ import com.azure.core.util.serializer.TypeReference; import com.azure.health.insights.radiologyinsights.RadiologyInsightsServiceVersion; import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsInferenceResult; -import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsResult; +import com.azure.health.insights.radiologyinsights.models.RadiologyInsightsJob; import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.UUID; import reactor.core.publisher.Mono; /** @@ -163,261 +160,238 @@ public RadiologyInsightsClientImpl(HttpPipeline httpPipeline, SerializerAdapter @Host("{endpoint}/health-insights") @ServiceInterface(name = "RadiologyInsightsCli") public interface RadiologyInsightsClientService { - @Post("/radiology-insights/jobs") - @ExpectedResponses({ 202 }) + @Put("/radiology-insights/jobs/{id}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> inferRadiologyInsights(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData radiologyInsightsData, RequestOptions requestOptions, - Context context); + @QueryParam("api-version") String apiVersion, @PathParam("id") String id, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); - @Post("/radiology-insights/jobs") - @ExpectedResponses({ 202 }) + @Put("/radiology-insights/jobs/{id}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response inferRadiologyInsightsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData radiologyInsightsData, RequestOptions requestOptions, - Context context); + @QueryParam("api-version") String apiVersion, @PathParam("id") String id, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); } /** * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
-     *         }
-     *         locale: String (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
-     *     error (Optional): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *         target: String (Optional)
-     *         details (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *         innererror (Optional): {
-     *             code: String (Optional)
-     *             innererror (Optional): (recursive schema, see innererror above)
+     *             locale: String (Optional)
      *         }
      *     }
      *     result (Optional): {
@@ -428,106 +402,7 @@ Response inferRadiologyInsightsSync(@HostParam("endpoint") String en
      *                      (Required){
      *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
      *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
-     *                                         id: String (Optional)
-     *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
-     *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
-     *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
-     *                                     }
-     *                                     display: String (Optional)
-     *                                 }
-     *                             }
+     *                             (recursive schema, see above)
      *                         ]
      *                     }
      *                 ]
@@ -535,273 +410,223 @@ Response inferRadiologyInsightsSync(@HostParam("endpoint") String en
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return provides status details for long running operations along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> inferRadiologyInsightsWithResponseAsync(BinaryData radiologyInsightsData, - RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-request-id")) == null) { - requestLocal.getHeaders() - .set(HttpHeaderName.fromString("repeatability-request-id"), repeatabilityRequestId); - } - }); - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-first-sent")) == null) { - requestLocal.getHeaders() - .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); - } - }); - return FluxUtil.withContext(context -> service.inferRadiologyInsights(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, radiologyInsightsData, requestOptionsLocal, context)); - } - - /** - * Create Radiology Insights job - * - * Creates a Radiology Insights job with the given request body. - *

Header Parameters

- * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

+ *

Response Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
-     *         }
-     *         locale: String (Optional)
-     *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
-     *     id: String (Required)
-     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
-     *     error (Optional): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *         target: String (Optional)
-     *         details (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *         innererror (Optional): {
-     *             code: String (Optional)
-     *             innererror (Optional): (recursive schema, see innererror above)
+     *             locale: String (Optional)
      *         }
      *     }
      *     result (Optional): {
@@ -812,106 +637,7 @@ private Mono> inferRadiologyInsightsWithResponseAsync(Binar
      *                      (Required){
      *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
      *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
-     *                                         id: String (Optional)
-     *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
-     *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
-     *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
-     *                                     }
-     *                                     display: String (Optional)
-     *                                 }
-     *                             }
+     *                             (recursive schema, see above)
      *                         ]
      *                     }
      *                 ]
@@ -919,262 +645,277 @@ private Mono> inferRadiologyInsightsWithResponseAsync(Binar
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return provides status details for long running operations along with {@link Response}. + * @return response for the Radiology Insights request along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response inferRadiologyInsightsWithResponse(BinaryData radiologyInsightsData, + private Mono> inferRadiologyInsightsWithResponseAsync(String id, BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - String repeatabilityRequestId = UUID.randomUUID().toString(); - String repeatabilityFirstSent = DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()); - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-request-id")) == null) { - requestLocal.getHeaders() - .set(HttpHeaderName.fromString("repeatability-request-id"), repeatabilityRequestId); - } - }); - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getHeaders().get(HttpHeaderName.fromString("repeatability-first-sent")) == null) { - requestLocal.getHeaders() - .set(HttpHeaderName.fromString("repeatability-first-sent"), repeatabilityFirstSent); - } - }); - return service.inferRadiologyInsightsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - radiologyInsightsData, requestOptionsLocal, Context.NONE); + return FluxUtil.withContext(context -> service.inferRadiologyInsights(this.getEndpoint(), + this.getServiceVersion().getVersion(), id, contentType, accept, resource, requestOptions, context)); } /** * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
+     *             locale: String (Optional)
      *         }
-     *         locale: String (Optional)
      *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
      *     id: String (Required)
      *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
      *     error (Optional): {
      *         code: String (Required)
      *         message: String (Required)
@@ -1187,370 +928,494 @@ private Response inferRadiologyInsightsWithResponse(BinaryData radio
      *             innererror (Optional): (recursive schema, see innererror above)
      *         }
      *     }
-     *     result (Optional): {
-     *         patientResults (Required): [
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
      *              (Required){
-     *                 patientId: String (Required)
-     *                 inferences (Required): [
-     *                      (Required){
-     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
-     *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
      *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
+     *                                 security (Optional): [
+     *                                      (Optional){
      *                                         id: String (Optional)
      *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
+     *                                              (Optional){
+     *                                                 id: String (Optional)
+     *                                                 extension (Optional): [
+     *                                                     (recursive schema, see above)
+     *                                                 ]
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
      *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
      *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
      *                                     }
-     *                                     display: String (Optional)
-     *                                 }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
      *                             }
      *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
      *                     }
      *                 ]
      *             }
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of provides status details for long running operations. + * @return response for the Radiology Insights request along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginInferRadiologyInsightsAsync(BinaryData radiologyInsightsData, + @ServiceMethod(returns = ReturnType.SINGLE) + private Response inferRadiologyInsightsWithResponse(String id, BinaryData resource, RequestOptions requestOptions) { - return PollerFlux.create(Duration.ofSeconds(1), - () -> this.inferRadiologyInsightsWithResponseAsync(radiologyInsightsData, requestOptions), - new com.azure.health.insights.radiologyinsights.implementation.OperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}/health-insights".replace("{endpoint}", this.getEndpoint())) - .setContext(requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE) - .setServiceVersion(this.getServiceVersion().getVersion()), - "result"), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.inferRadiologyInsightsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, + contentType, accept, resource, requestOptions, Context.NONE); } /** * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
-     *                                             }
-     *                                         }
-     *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
-     *                                 }
-     *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
-     *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
-     *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
      *                         }
      *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
      *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
      *                             }
      *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
      *                     }
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 ]
      *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
      *             }
+     *             locale: String (Optional)
      *         }
-     *         locale: String (Optional)
      *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
      *     id: String (Required)
      *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
      *     error (Optional): {
      *         code: String (Required)
      *         message: String (Required)
@@ -1563,138 +1428,259 @@ public PollerFlux beginInferRadiologyInsightsAsync(Binar
      *             innererror (Optional): (recursive schema, see innererror above)
      *         }
      *     }
-     *     result (Optional): {
-     *         patientResults (Required): [
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
      *              (Required){
-     *                 patientId: String (Required)
-     *                 inferences (Required): [
-     *                      (Required){
-     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
-     *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
      *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
+     *                                 security (Optional): [
+     *                                      (Optional){
      *                                         id: String (Optional)
      *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
+     *                                              (Optional){
+     *                                                 id: String (Optional)
+     *                                                 extension (Optional): [
+     *                                                     (recursive schema, see above)
+     *                                                 ]
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
      *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
      *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
      *                                     }
-     *                                     display: String (Optional)
-     *                                 }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
      *                             }
      *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
      *                     }
      *                 ]
      *             }
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of provides status details for long running operations. + * @return the {@link PollerFlux} for polling of response for the Radiology Insights request. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginInferRadiologyInsights(BinaryData radiologyInsightsData, + public PollerFlux beginInferRadiologyInsightsAsync(String id, BinaryData resource, RequestOptions requestOptions) { - return SyncPoller.createPoller(Duration.ofSeconds(1), - () -> this.inferRadiologyInsightsWithResponse(radiologyInsightsData, requestOptions), - new com.azure.health.insights.radiologyinsights.implementation.SyncOperationLocationPollingStrategy<>( + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.inferRadiologyInsightsWithResponseAsync(id, resource, requestOptions), + new com.azure.health.insights.radiologyinsights.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) .setEndpoint("{endpoint}/health-insights".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null @@ -1709,224 +1695,741 @@ public SyncPoller beginInferRadiologyInsights(BinaryData * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
{@code
      * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
      *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
      *                                             }
-     *                                             valueReference (Optional): {
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param id The unique ID of the job. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of response for the Radiology Insights request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginInferRadiologyInsights(String id, BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.inferRadiologyInsightsWithResponse(id, resource, requestOptions), + new com.azure.health.insights.radiologyinsights.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/health-insights".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Create Radiology Insights job + * + * Creates a Radiology Insights job with the given request body. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
-     *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
+     *             locale: String (Optional)
      *         }
-     *         locale: String (Optional)
      *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
      *     id: String (Required)
      *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
      *     error (Optional): {
      *         code: String (Required)
      *         message: String (Required)
@@ -1939,137 +2442,258 @@ public SyncPoller beginInferRadiologyInsights(BinaryData
      *             innererror (Optional): (recursive schema, see innererror above)
      *         }
      *     }
-     *     result (Optional): {
-     *         patientResults (Required): [
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
      *              (Required){
-     *                 patientId: String (Required)
-     *                 inferences (Required): [
-     *                      (Required){
-     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
-     *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
      *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
+     *                                 security (Optional): [
+     *                                      (Optional){
      *                                         id: String (Optional)
      *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
+     *                                              (Optional){
+     *                                                 id: String (Optional)
+     *                                                 extension (Optional): [
+     *                                                     (recursive schema, see above)
+     *                                                 ]
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
      *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
      *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
      *                                     }
-     *                                     display: String (Optional)
-     *                                 }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
      *                             }
      *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
      *                     }
      *                 ]
      *             }
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of provides status details for long running operations. + * @return the {@link PollerFlux} for polling of response for the Radiology Insights request. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux - beginInferRadiologyInsightsWithModelAsync(BinaryData radiologyInsightsData, RequestOptions requestOptions) { + public PollerFlux + beginInferRadiologyInsightsWithModelAsync(String id, BinaryData resource, RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), - () -> this.inferRadiologyInsightsWithResponseAsync(radiologyInsightsData, requestOptions), + () -> this.inferRadiologyInsightsWithResponseAsync(id, resource, requestOptions), new com.azure.health.insights.radiologyinsights.implementation.OperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) .setEndpoint("{endpoint}/health-insights".replace("{endpoint}", this.getEndpoint())) @@ -2078,7 +2702,7 @@ public SyncPoller beginInferRadiologyInsights(BinaryData : Context.NONE) .setServiceVersion(this.getServiceVersion().getVersion()), "result"), - TypeReference.createInstance(RadiologyInsightsResult.class), + TypeReference.createInstance(RadiologyInsightsJob.class), TypeReference.createInstance(RadiologyInsightsInferenceResult.class)); } @@ -2086,224 +2710,234 @@ public SyncPoller beginInferRadiologyInsights(BinaryData * Create Radiology Insights job * * Creates a Radiology Insights job with the given request body. - *

Header Parameters

+ *

Query Parameters

* - * + * * - * - * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
repeatability-request-idStringNoRepeatability request ID header
repeatability-first-sentStringNoRepeatability first sent header as - * HTTP-date
expandList<String>NoExpand the indicated resources into the response. + * Call {@link RequestOptions#addQueryParam} to add string to array.
- * You can add these to a request with {@link RequestOptions#addHeader} + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

- * - *
{@code
-     * {
-     *     patients (Required): [
-     *          (Required){
-     *             id: String (Required)
-     *             info (Optional): {
-     *                 sex: String(female/male/unspecified) (Optional)
-     *                 birthDate: LocalDate (Optional)
-     *                 clinicalInfo (Optional): [
-     *                      (Optional){
-     *                         resourceType: String (Required)
-     *                         id: String (Optional)
-     *                         meta (Optional): {
-     *                             versionId: String (Optional)
-     *                             lastUpdated: String (Optional)
-     *                             source: String (Optional)
-     *                             profile (Optional): [
-     *                                 String (Optional)
-     *                             ]
-     *                             security (Optional): [
-     *                                  (Optional){
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             url: String (Required)
-     *                                             valueQuantity (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 value: Double (Optional)
-     *                                                 comparator: String (Optional)
-     *                                                 unit: String (Optional)
-     *                                                 system: String (Optional)
-     *                                                 code: String (Optional)
-     *                                             }
-     *                                             valueCodeableConcept (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 coding (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 text: String (Optional)
-     *                                             }
-     *                                             valueString: String (Optional)
-     *                                             valueBoolean: Boolean (Optional)
-     *                                             valueInteger: Integer (Optional)
-     *                                             valueRange (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 low (Optional): (recursive schema, see low above)
-     *                                                 high (Optional): (recursive schema, see high above)
-     *                                             }
-     *                                             valueRatio (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 numerator (Optional): (recursive schema, see numerator above)
-     *                                                 denominator (Optional): (recursive schema, see denominator above)
-     *                                             }
-     *                                             valueSampledData (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 origin (Required): (recursive schema, see origin above)
-     *                                                 period: double (Required)
-     *                                                 factor: Double (Optional)
-     *                                                 lowerLimit: Double (Optional)
-     *                                                 upperLimit: Double (Optional)
-     *                                                 dimensions: int (Required)
-     *                                                 data: String (Optional)
-     *                                             }
-     *                                             valueTime: String (Optional)
-     *                                             valueDateTime: String (Optional)
-     *                                             valuePeriod (Optional): {
-     *                                                 id: String (Optional)
-     *                                                 extension (Optional): [
-     *                                                     (recursive schema, see above)
-     *                                                 ]
-     *                                                 start: String (Optional)
-     *                                                 end: String (Optional)
-     *                                             }
-     *                                             valueReference (Optional): {
+     * 
+     * 
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
+     *              (Required){
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
+     *                                 ]
+     *                                 security (Optional): [
+     *                                      (Optional){
+     *                                         id: String (Optional)
+     *                                         extension (Optional): [
+     *                                              (Optional){
      *                                                 id: String (Optional)
      *                                                 extension (Optional): [
      *                                                     (recursive schema, see above)
      *                                                 ]
-     *                                                 reference: String (Optional)
-     *                                                 type: String (Optional)
-     *                                                 identifier (Optional): {
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
      *                                                     id: String (Optional)
      *                                                     extension (Optional): [
      *                                                         (recursive schema, see above)
      *                                                     ]
-     *                                                     use: String (Optional)
-     *                                                     type (Optional): (recursive schema, see type above)
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
      *                                                     system: String (Optional)
-     *                                                     value: String (Optional)
-     *                                                     period (Optional): (recursive schema, see period above)
-     *                                                     assigner (Optional): (recursive schema, see assigner above)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
      *                                                 }
-     *                                                 display: String (Optional)
      *                                             }
-     *                                         }
+     *                                         ]
+     *                                         system: String (Optional)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
+     *                                     }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
+     *                             }
+     *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
      *                                     ]
-     *                                     system: String (Optional)
-     *                                     version: String (Optional)
-     *                                     code: String (Optional)
-     *                                     display: String (Optional)
      *                                 }
      *                             ]
-     *                             tag (Optional): [
-     *                                 (recursive schema, see above)
-     *                             ]
+     *                             encounterId: String (Optional)
      *                         }
-     *                         implicitRules: String (Optional)
-     *                         language: String (Optional)
-     *                          (Optional): {
-     *                             String: Object (Required)
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
      *                         }
      *                     }
      *                 ]
      *             }
-     *             encounters (Optional): [
-     *                  (Optional){
-     *                     id: String (Required)
-     *                     period (Optional): {
-     *                         start: OffsetDateTime (Optional)
-     *                         end: OffsetDateTime (Optional)
-     *                     }
-     *                     class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
-     *                 }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
      *             ]
-     *             patientDocuments (Optional): [
-     *                  (Optional){
-     *                     type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
-     *                     clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
-     *                     id: String (Required)
-     *                     language: String (Optional)
-     *                     createdDateTime: OffsetDateTime (Optional)
-     *                     authors (Optional): [
-     *                          (Optional){
-     *                             id: String (Optional)
-     *                             fullName: String (Optional)
-     *                         }
-     *                     ]
-     *                     specialtyType: String(pathology/radiology) (Optional)
-     *                     administrativeMetadata (Optional): {
-     *                         orderedProcedures (Optional): [
-     *                              (Optional){
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
-     *                                 ]
-     *                                 code (Optional): (recursive schema, see code above)
-     *                                 description: String (Optional)
-     *                             }
-     *                         ]
-     *                         encounterId: String (Optional)
-     *                     }
-     *                     content (Required): {
-     *                         sourceType: String(inline/reference) (Required)
-     *                         value: String (Required)
-     *                     }
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
      *                 }
-     *             ]
-     *         }
-     *     ]
-     *     configuration (Optional): {
-     *         verbose: Boolean (Optional)
-     *         includeEvidence: Boolean (Optional)
-     *         inferenceTypes (Optional): [
-     *             String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
-     *         ]
-     *         inferenceOptions (Optional): {
-     *             followupRecommendationOptions (Optional): {
-     *                 includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
-     *                 includeRecommendationsInReferences: Boolean (Optional)
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
-     *             }
-     *             findingOptions (Optional): {
-     *                 provideFocusedSentenceEvidence: Boolean (Optional)
      *             }
+     *             locale: String (Optional)
      *         }
-     *         locale: String (Optional)
      *     }
-     * }
-     * }
- * - *

Response Body Schema

- * - *
{@code
-     * {
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         modelVersion: String (Required)
+     *     }
      *     id: String (Required)
      *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     expirationDateTime: OffsetDateTime (Optional)
-     *     lastUpdateDateTime: OffsetDateTime (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
      *     error (Optional): {
      *         code: String (Required)
      *         message: String (Required)
@@ -2316,137 +2950,258 @@ public SyncPoller beginInferRadiologyInsights(BinaryData
      *             innererror (Optional): (recursive schema, see innererror above)
      *         }
      *     }
-     *     result (Optional): {
-     *         patientResults (Required): [
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     jobData (Optional): {
+     *         patients (Required): [
      *              (Required){
-     *                 patientId: String (Required)
-     *                 inferences (Required): [
-     *                      (Required){
-     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
-     *                         extension (Optional): [
-     *                              (Optional){
-     *                                 id: String (Optional)
-     *                                 extension (Optional): [
-     *                                     (recursive schema, see above)
+     *                 id: String (Required)
+     *                 details (Optional): {
+     *                     sex: String(female/male/unspecified) (Optional)
+     *                     birthDate: LocalDate (Optional)
+     *                     clinicalInfo (Optional): [
+     *                          (Optional){
+     *                             resourceType: String (Required)
+     *                             id: String (Optional)
+     *                             meta (Optional): {
+     *                                 versionId: String (Optional)
+     *                                 lastUpdated: String (Optional)
+     *                                 source: String (Optional)
+     *                                 profile (Optional): [
+     *                                     String (Optional)
      *                                 ]
-     *                                 url: String (Required)
-     *                                 valueQuantity (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     value: Double (Optional)
-     *                                     comparator: String (Optional)
-     *                                     unit: String (Optional)
-     *                                     system: String (Optional)
-     *                                     code: String (Optional)
-     *                                 }
-     *                                 valueCodeableConcept (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     coding (Optional): [
-     *                                          (Optional){
-     *                                             id: String (Optional)
-     *                                             extension (Optional): [
-     *                                                 (recursive schema, see above)
-     *                                             ]
-     *                                             system: String (Optional)
-     *                                             version: String (Optional)
-     *                                             code: String (Optional)
-     *                                             display: String (Optional)
-     *                                         }
-     *                                     ]
-     *                                     text: String (Optional)
-     *                                 }
-     *                                 valueString: String (Optional)
-     *                                 valueBoolean: Boolean (Optional)
-     *                                 valueInteger: Integer (Optional)
-     *                                 valueRange (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     low (Optional): (recursive schema, see low above)
-     *                                     high (Optional): (recursive schema, see high above)
-     *                                 }
-     *                                 valueRatio (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     numerator (Optional): (recursive schema, see numerator above)
-     *                                     denominator (Optional): (recursive schema, see denominator above)
-     *                                 }
-     *                                 valueSampledData (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     origin (Required): (recursive schema, see origin above)
-     *                                     period: double (Required)
-     *                                     factor: Double (Optional)
-     *                                     lowerLimit: Double (Optional)
-     *                                     upperLimit: Double (Optional)
-     *                                     dimensions: int (Required)
-     *                                     data: String (Optional)
-     *                                 }
-     *                                 valueTime: String (Optional)
-     *                                 valueDateTime: String (Optional)
-     *                                 valuePeriod (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     start: String (Optional)
-     *                                     end: String (Optional)
-     *                                 }
-     *                                 valueReference (Optional): {
-     *                                     id: String (Optional)
-     *                                     extension (Optional): [
-     *                                         (recursive schema, see above)
-     *                                     ]
-     *                                     reference: String (Optional)
-     *                                     type: String (Optional)
-     *                                     identifier (Optional): {
+     *                                 security (Optional): [
+     *                                      (Optional){
      *                                         id: String (Optional)
      *                                         extension (Optional): [
-     *                                             (recursive schema, see above)
+     *                                              (Optional){
+     *                                                 id: String (Optional)
+     *                                                 extension (Optional): [
+     *                                                     (recursive schema, see above)
+     *                                                 ]
+     *                                                 url: String (Required)
+     *                                                 valueQuantity (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     value: Double (Optional)
+     *                                                     comparator: String (Optional)
+     *                                                     unit: String (Optional)
+     *                                                     system: String (Optional)
+     *                                                     code: String (Optional)
+     *                                                 }
+     *                                                 valueCodeableConcept (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     coding (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     text: String (Optional)
+     *                                                 }
+     *                                                 valueString: String (Optional)
+     *                                                 valueBoolean: Boolean (Optional)
+     *                                                 valueInteger: Integer (Optional)
+     *                                                 valueRange (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     low (Optional): (recursive schema, see low above)
+     *                                                     high (Optional): (recursive schema, see high above)
+     *                                                 }
+     *                                                 valueRatio (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     numerator (Optional): (recursive schema, see numerator above)
+     *                                                     denominator (Optional): (recursive schema, see denominator above)
+     *                                                 }
+     *                                                 valueSampledData (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     origin (Required): (recursive schema, see origin above)
+     *                                                     period: double (Required)
+     *                                                     factor: Double (Optional)
+     *                                                     lowerLimit: Double (Optional)
+     *                                                     upperLimit: Double (Optional)
+     *                                                     dimensions: int (Required)
+     *                                                     data: String (Optional)
+     *                                                 }
+     *                                                 valueTime: String (Optional)
+     *                                                 valueDateTime: String (Optional)
+     *                                                 valuePeriod (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     start: String (Optional)
+     *                                                     end: String (Optional)
+     *                                                 }
+     *                                                 valueReference (Optional): {
+     *                                                     id: String (Optional)
+     *                                                     extension (Optional): [
+     *                                                         (recursive schema, see above)
+     *                                                     ]
+     *                                                     reference: String (Optional)
+     *                                                     type: String (Optional)
+     *                                                     identifier (Optional): {
+     *                                                         id: String (Optional)
+     *                                                         extension (Optional): [
+     *                                                             (recursive schema, see above)
+     *                                                         ]
+     *                                                         use: String (Optional)
+     *                                                         type (Optional): (recursive schema, see type above)
+     *                                                         system: String (Optional)
+     *                                                         value: String (Optional)
+     *                                                         period (Optional): (recursive schema, see period above)
+     *                                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                                     }
+     *                                                     display: String (Optional)
+     *                                                 }
+     *                                             }
      *                                         ]
-     *                                         use: String (Optional)
-     *                                         type (Optional): (recursive schema, see type above)
      *                                         system: String (Optional)
-     *                                         value: String (Optional)
-     *                                         period (Optional): (recursive schema, see period above)
-     *                                         assigner (Optional): (recursive schema, see assigner above)
+     *                                         version: String (Optional)
+     *                                         code: String (Optional)
+     *                                         display: String (Optional)
      *                                     }
-     *                                     display: String (Optional)
-     *                                 }
+     *                                 ]
+     *                                 tag (Optional): [
+     *                                     (recursive schema, see above)
+     *                                 ]
+     *                             }
+     *                             implicitRules: String (Optional)
+     *                             language: String (Optional)
+     *                              (Optional): {
+     *                                 String: Object (Required)
+     *                             }
+     *                         }
+     *                     ]
+     *                 }
+     *                 encounters (Optional): [
+     *                      (Optional){
+     *                         id: String (Required)
+     *                         period (Optional): {
+     *                             start: OffsetDateTime (Optional)
+     *                             end: OffsetDateTime (Optional)
+     *                         }
+     *                         class: String(inpatient/ambulatory/observation/emergency/virtual/healthHome) (Optional)
+     *                     }
+     *                 ]
+     *                 patientDocuments (Optional): [
+     *                      (Optional){
+     *                         type: String(note/fhirBundle/dicom/genomicSequencing) (Required)
+     *                         clinicalType: String(consultation/dischargeSummary/historyAndPhysical/radiologyReport/procedure/progress/laboratory/pathologyReport) (Optional)
+     *                         id: String (Required)
+     *                         language: String (Optional)
+     *                         createdAt: OffsetDateTime (Optional)
+     *                         authors (Optional): [
+     *                              (Optional){
+     *                                 id: String (Optional)
+     *                                 fullName: String (Optional)
      *                             }
      *                         ]
+     *                         specialtyType: String(pathology/radiology) (Optional)
+     *                         administrativeMetadata (Optional): {
+     *                             orderedProcedures (Optional): [
+     *                                  (Optional){
+     *                                     code (Optional): (recursive schema, see code above)
+     *                                     description: String (Optional)
+     *                                     extension (Optional): [
+     *                                         (recursive schema, see above)
+     *                                     ]
+     *                                 }
+     *                             ]
+     *                             encounterId: String (Optional)
+     *                         }
+     *                         content (Required): {
+     *                             sourceType: String(inline/reference) (Required)
+     *                             value: String (Required)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         configuration (Optional): {
+     *             verbose: Boolean (Optional)
+     *             includeEvidence: Boolean (Optional)
+     *             inferenceTypes (Optional): [
+     *                 String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Optional)
+     *             ]
+     *             inferenceOptions (Optional): {
+     *                 followupRecommendationOptions (Optional): {
+     *                     includeRecommendationsWithNoSpecifiedModality: Boolean (Optional)
+     *                     includeRecommendationsInReferences: Boolean (Optional)
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *                 findingOptions (Optional): {
+     *                     provideFocusedSentenceEvidence: Boolean (Optional)
+     *                 }
+     *             }
+     *             locale: String (Optional)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         patientResults (Required): [
+     *              (Required){
+     *                 patientId: String (Required)
+     *                 inferences (Required): [
+     *                      (Required){
+     *                         kind: String(ageMismatch/lateralityDiscrepancy/sexMismatch/completeOrderDiscrepancy/limitedOrderDiscrepancy/finding/criticalResult/followupRecommendation/followupCommunication/radiologyProcedure) (Required)
+     *                         extension (Optional): [
+     *                             (recursive schema, see above)
+     *                         ]
      *                     }
      *                 ]
      *             }
      *         ]
      *         modelVersion: String (Required)
      *     }
+     *     id: String (Required)
+     *     status: String(notStarted/running/succeeded/failed/canceled) (Required)
+     *     createdAt: OffsetDateTime (Optional)
+     *     expiresAt: OffsetDateTime (Optional)
+     *     updatedAt: OffsetDateTime (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
      * }
      * }
* - * @param radiologyInsightsData Contains the list of patients, and configuration data. + * @param id The unique ID of the job. + * @param resource The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of provides status details for long running operations. + * @return the {@link SyncPoller} for polling of response for the Radiology Insights request. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller - beginInferRadiologyInsightsWithModel(BinaryData radiologyInsightsData, RequestOptions requestOptions) { + public SyncPoller + beginInferRadiologyInsightsWithModel(String id, BinaryData resource, RequestOptions requestOptions) { return SyncPoller.createPoller(Duration.ofSeconds(1), - () -> this.inferRadiologyInsightsWithResponse(radiologyInsightsData, requestOptions), + () -> this.inferRadiologyInsightsWithResponse(id, resource, requestOptions), new com.azure.health.insights.radiologyinsights.implementation.SyncOperationLocationPollingStrategy<>( new PollingStrategyOptions(this.getHttpPipeline()) .setEndpoint("{endpoint}/health-insights".replace("{endpoint}", this.getEndpoint())) @@ -2455,7 +3210,7 @@ public SyncPoller beginInferRadiologyInsights(BinaryData : Context.NONE) .setServiceVersion(this.getServiceVersion().getVersion()), "result"), - TypeReference.createInstance(RadiologyInsightsResult.class), + TypeReference.createInstance(RadiologyInsightsJob.class), TypeReference.createInstance(RadiologyInsightsInferenceResult.class)); } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/AgeMismatchInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/AgeMismatchInference.java index 5c62da90dd268..2a3d4cbe8ab84 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/AgeMismatchInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/AgeMismatchInference.java @@ -5,17 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * A notification for age mismatch is displayed when the age mentioned in a document for a specific patient does not * match the age specified in the patient information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = AgeMismatchInference.class, visible = true) -@JsonTypeName("ageMismatch") @Immutable public final class AgeMismatchInference extends RadiologyInsightsInference { @@ -23,8 +22,6 @@ public final class AgeMismatchInference extends RadiologyInsightsInference { * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.AGE_MISMATCH; /** @@ -44,4 +41,62 @@ private AgeMismatchInference() { public RadiologyInsightsInferenceType getKind() { return this.kind; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgeMismatchInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgeMismatchInference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgeMismatchInference. + */ + @Generated + public static AgeMismatchInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgeMismatchInference deserializedAgeMismatchInference = new AgeMismatchInference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedAgeMismatchInference.extension = extension; + } else if ("kind".equals(fieldName)) { + deserializedAgeMismatchInference.kind + = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedAgeMismatchInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ClinicalDocumentType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ClinicalDocumentType.java index a4cbd9edbc6a6..c4aaddd8df25c 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ClinicalDocumentType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ClinicalDocumentType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -78,7 +77,6 @@ public ClinicalDocumentType() { * @return the corresponding ClinicalDocumentType. */ @Generated - @JsonCreator public static ClinicalDocumentType fromString(String name) { return fromString(name, ClinicalDocumentType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CompleteOrderDiscrepancyInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CompleteOrderDiscrepancyInference.java index 21bcadcc5ceff..91c32832e65dd 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CompleteOrderDiscrepancyInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CompleteOrderDiscrepancyInference.java @@ -5,23 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * A complete order discrepancy is shown when one or more body parts and/or measurements that should be in the document * (because there is a complete order) are not present. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = CompleteOrderDiscrepancyInference.class, - visible = true) -@JsonTypeName("completeOrderDiscrepancy") @Immutable public final class CompleteOrderDiscrepancyInference extends RadiologyInsightsInference { @@ -29,29 +22,24 @@ public final class CompleteOrderDiscrepancyInference extends RadiologyInsightsIn * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY; /* * Order type : CPT ultrasound complete code for abdomen, retroperitoneal, pelvis or breast. */ @Generated - @JsonProperty(value = "orderType") private final FhirR4CodeableConcept orderType; /* * List of missing body parts required by a complete order : SNOMED CT codes. */ @Generated - @JsonProperty(value = "missingBodyParts") private List missingBodyParts; /* * List of missing body parts that require measurement by a complete order : SNOMED CT codes. */ @Generated - @JsonProperty(value = "missingBodyPartMeasurements") private List missingBodyPartMeasurements; /** @@ -60,8 +48,7 @@ public final class CompleteOrderDiscrepancyInference extends RadiologyInsightsIn * @param orderType the orderType value to set. */ @Generated - @JsonCreator - private CompleteOrderDiscrepancyInference(@JsonProperty(value = "orderType") FhirR4CodeableConcept orderType) { + private CompleteOrderDiscrepancyInference(FhirR4CodeableConcept orderType) { this.orderType = orderType; } @@ -107,4 +94,82 @@ public List getMissingBodyParts() { public List getMissingBodyPartMeasurements() { return this.missingBodyPartMeasurements; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("orderType", this.orderType); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("missingBodyParts", this.missingBodyParts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("missingBodyPartMeasurements", this.missingBodyPartMeasurements, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompleteOrderDiscrepancyInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompleteOrderDiscrepancyInference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CompleteOrderDiscrepancyInference. + */ + @Generated + public static CompleteOrderDiscrepancyInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + FhirR4CodeableConcept orderType = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.COMPLETE_ORDER_DISCREPANCY; + List missingBodyParts = null; + List missingBodyPartMeasurements = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("orderType".equals(fieldName)) { + orderType = FhirR4CodeableConcept.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("missingBodyParts".equals(fieldName)) { + missingBodyParts = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("missingBodyPartMeasurements".equals(fieldName)) { + missingBodyPartMeasurements = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + CompleteOrderDiscrepancyInference deserializedCompleteOrderDiscrepancyInference + = new CompleteOrderDiscrepancyInference(orderType); + deserializedCompleteOrderDiscrepancyInference.extension = extension; + deserializedCompleteOrderDiscrepancyInference.kind = kind; + deserializedCompleteOrderDiscrepancyInference.missingBodyParts = missingBodyParts; + deserializedCompleteOrderDiscrepancyInference.missingBodyPartMeasurements = missingBodyPartMeasurements; + return deserializedCompleteOrderDiscrepancyInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointSystem.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointSystem.java index 978ca28b9e3cc..aa36cee3953d0 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointSystem.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointSystem.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -73,7 +72,6 @@ public ContactPointSystem() { * @return the corresponding ContactPointSystem. */ @Generated - @JsonCreator public static ContactPointSystem fromString(String name) { return fromString(name, ContactPointSystem.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointUse.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointUse.java index c5f698748b375..bf5111509e6c2 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointUse.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ContactPointUse.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -61,7 +60,6 @@ public ContactPointUse() { * @return the corresponding ContactPointUse. */ @Generated - @JsonCreator public static ContactPointUse fromString(String name) { return fromString(name, ContactPointUse.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResult.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResult.java index 2e9db2e779b90..7ec6c1cfd89d5 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResult.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResult.java @@ -5,27 +5,28 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Critical Result consists of two properties. */ @Immutable -public final class CriticalResult { +public final class CriticalResult implements JsonSerializable { /* * Description : medical problem. */ @Generated - @JsonProperty(value = "description") private final String description; /* * Finding linked to the critical result. */ @Generated - @JsonProperty(value = "finding") private FhirR4Observation finding; /** @@ -34,8 +35,7 @@ public final class CriticalResult { * @param description the description value to set. */ @Generated - @JsonCreator - private CriticalResult(@JsonProperty(value = "description") String description) { + private CriticalResult(String description) { this.description = description; } @@ -58,4 +58,47 @@ public String getDescription() { public FhirR4Observation getFinding() { return this.finding; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("finding", this.finding); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CriticalResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CriticalResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CriticalResult. + */ + @Generated + public static CriticalResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String description = null; + FhirR4Observation finding = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("finding".equals(fieldName)) { + finding = FhirR4Observation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + CriticalResult deserializedCriticalResult = new CriticalResult(description); + deserializedCriticalResult.finding = finding; + return deserializedCriticalResult; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResultInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResultInference.java index bf74d0fc12f74..604966a04268b 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResultInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/CriticalResultInference.java @@ -5,22 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * Critical results refer to findings of utmost importance that may require timely attention due to their potential * impact on patient care. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = CriticalResultInference.class, - visible = true) -@JsonTypeName("criticalResult") @Immutable public final class CriticalResultInference extends RadiologyInsightsInference { @@ -28,15 +22,12 @@ public final class CriticalResultInference extends RadiologyInsightsInference { * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.CRITICAL_RESULT; /* * The complete Critical Result, as outlined below, will be reused for the recommendation. */ @Generated - @JsonProperty(value = "result") private final CriticalResult result; /** @@ -45,8 +36,7 @@ public final class CriticalResultInference extends RadiologyInsightsInference { * @param result the result value to set. */ @Generated - @JsonCreator - private CriticalResultInference(@JsonProperty(value = "result") CriticalResult result) { + private CriticalResultInference(CriticalResult result) { this.result = result; } @@ -70,4 +60,69 @@ public RadiologyInsightsInferenceType getKind() { public CriticalResult getResult() { return this.result; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CriticalResultInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CriticalResultInference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CriticalResultInference. + */ + @Generated + public static CriticalResultInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + CriticalResult result = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.CRITICAL_RESULT; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("result".equals(fieldName)) { + result = CriticalResult.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + CriticalResultInference deserializedCriticalResultInference = new CriticalResultInference(result); + deserializedCriticalResultInference.extension = extension; + deserializedCriticalResultInference.kind = kind; + return deserializedCriticalResultInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAdministrativeMetadata.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAdministrativeMetadata.java index 00c9bd393c91b..58f4bb6b89dd9 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAdministrativeMetadata.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAdministrativeMetadata.java @@ -5,27 +5,29 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Document administrative metadata. */ @Fluent -public final class DocumentAdministrativeMetadata { +public final class DocumentAdministrativeMetadata implements JsonSerializable { /* * List of procedure information associated with the document. */ @Generated - @JsonProperty(value = "orderedProcedures") private List orderedProcedures; /* * Reference to the encounter associated with the document. */ @Generated - @JsonProperty(value = "encounterId") private String encounterId; /** @@ -78,4 +80,47 @@ public DocumentAdministrativeMetadata setEncounterId(String encounterId) { this.encounterId = encounterId; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("orderedProcedures", this.orderedProcedures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("encounterId", this.encounterId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DocumentAdministrativeMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DocumentAdministrativeMetadata if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DocumentAdministrativeMetadata. + */ + @Generated + public static DocumentAdministrativeMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DocumentAdministrativeMetadata deserializedDocumentAdministrativeMetadata + = new DocumentAdministrativeMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("orderedProcedures".equals(fieldName)) { + List orderedProcedures + = reader.readArray(reader1 -> OrderedProcedure.fromJson(reader1)); + deserializedDocumentAdministrativeMetadata.orderedProcedures = orderedProcedures; + } else if ("encounterId".equals(fieldName)) { + deserializedDocumentAdministrativeMetadata.encounterId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDocumentAdministrativeMetadata; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAuthor.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAuthor.java index 1ca75cac5f422..b87e3165a39d6 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAuthor.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentAuthor.java @@ -5,26 +5,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Document author. */ @Fluent -public final class DocumentAuthor { +public final class DocumentAuthor implements JsonSerializable { /* * author id */ @Generated - @JsonProperty(value = "id") private String id; /* * Text representation of the full name */ @Generated - @JsonProperty(value = "fullName") private String fullName; /** @@ -77,4 +79,43 @@ public DocumentAuthor setFullName(String fullName) { this.fullName = fullName; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("fullName", this.fullName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DocumentAuthor from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DocumentAuthor if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DocumentAuthor. + */ + @Generated + public static DocumentAuthor fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DocumentAuthor deserializedDocumentAuthor = new DocumentAuthor(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedDocumentAuthor.id = reader.getString(); + } else if ("fullName".equals(fieldName)) { + deserializedDocumentAuthor.fullName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDocumentAuthor; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContent.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContent.java index 813daf743861e..a1d6b2eaf254f 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContent.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContent.java @@ -5,14 +5,17 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The content of the patient document. */ @Immutable -public final class DocumentContent { +public final class DocumentContent implements JsonSerializable { /* * The type of the content's source. @@ -20,14 +23,12 @@ public final class DocumentContent { * In case the source type is 'reference', the content is given as a URI. */ @Generated - @JsonProperty(value = "sourceType") private final DocumentContentSourceType sourceType; /* * The content of the document, given either inline (as a string) or as a reference (URI). */ @Generated - @JsonProperty(value = "value") private final String value; /** @@ -37,9 +38,7 @@ public final class DocumentContent { * @param value the value value to set. */ @Generated - @JsonCreator - public DocumentContent(@JsonProperty(value = "sourceType") DocumentContentSourceType sourceType, - @JsonProperty(value = "value") String value) { + public DocumentContent(DocumentContentSourceType sourceType, String value) { this.sourceType = sourceType; this.value = value; } @@ -65,4 +64,45 @@ public DocumentContentSourceType getSourceType() { public String getValue() { return this.value; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceType", this.sourceType == null ? null : this.sourceType.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DocumentContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DocumentContent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DocumentContent. + */ + @Generated + public static DocumentContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DocumentContentSourceType sourceType = null; + String value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("sourceType".equals(fieldName)) { + sourceType = DocumentContentSourceType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new DocumentContent(sourceType, value); + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContentSourceType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContentSourceType.java index cc048c890d154..daac504e2ee11 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContentSourceType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentContentSourceType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -44,7 +43,6 @@ public DocumentContentSourceType() { * @return the corresponding DocumentContentSourceType. */ @Generated - @JsonCreator public static DocumentContentSourceType fromString(String name) { return fromString(name, DocumentContentSourceType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentType.java index 9f018c4828361..59ab463370f52 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/DocumentType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -54,7 +53,6 @@ public DocumentType() { * @return the corresponding DocumentType. */ @Generated - @JsonCreator public static DocumentType fromString(String name) { return fromString(name, DocumentType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/EncounterClass.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/EncounterClass.java index 8065adeae6976..82aa6fc7a87ac 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/EncounterClass.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/EncounterClass.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -74,7 +73,6 @@ public EncounterClass() { * @return the corresponding EncounterClass. */ @Generated - @JsonCreator public static EncounterClass fromString(String name) { return fromString(name, EncounterClass.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Annotation.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Annotation.java index b47630ca3632d..544254ba559ad 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Annotation.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Annotation.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * A text note which also contains information about who made the statement and when @@ -19,21 +22,18 @@ public final class FhirR4Annotation extends FhirR4Element { * Individual responsible for the annotation */ @Generated - @JsonProperty(value = "authorString") private String authorString; /* * When the annotation was made */ @Generated - @JsonProperty(value = "time") private String time; /* * The annotation - text content (as markdown) */ @Generated - @JsonProperty(value = "text") private final String text; /** @@ -42,8 +42,7 @@ public final class FhirR4Annotation extends FhirR4Element { * @param text the text value to set. */ @Generated - @JsonCreator - private FhirR4Annotation(@JsonProperty(value = "text") String text) { + private FhirR4Annotation(String text) { this.text = text; } @@ -76,4 +75,62 @@ public String getTime() { public String getText() { return this.text; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("authorString", this.authorString); + jsonWriter.writeStringField("time", this.time); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Annotation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Annotation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4Annotation. + */ + @Generated + public static FhirR4Annotation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + List extension = null; + String text = null; + String authorString = null; + String time = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("authorString".equals(fieldName)) { + authorString = reader.getString(); + } else if ("time".equals(fieldName)) { + time = reader.getString(); + } else { + reader.skipChildren(); + } + } + FhirR4Annotation deserializedFhirR4Annotation = new FhirR4Annotation(text); + deserializedFhirR4Annotation.setId(id); + deserializedFhirR4Annotation.setExtension(extension); + deserializedFhirR4Annotation.authorString = authorString; + deserializedFhirR4Annotation.time = time; + return deserializedFhirR4Annotation; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4CodeableConcept.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4CodeableConcept.java index ebef937de25ae..1a1018c4404db 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4CodeableConcept.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4CodeableConcept.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,14 +22,12 @@ public final class FhirR4CodeableConcept extends FhirR4Element { * Code defined by a terminology system */ @Generated - @JsonProperty(value = "coding") private List coding; /* * Plain text representation of the concept */ @Generated - @JsonProperty(value = "text") private String text; /** @@ -99,4 +100,51 @@ public FhirR4CodeableConcept setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("coding", this.coding, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("text", this.text); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4CodeableConcept from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4CodeableConcept if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4CodeableConcept. + */ + @Generated + public static FhirR4CodeableConcept fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4CodeableConcept deserializedFhirR4CodeableConcept = new FhirR4CodeableConcept(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4CodeableConcept.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4CodeableConcept.setExtension(extension); + } else if ("coding".equals(fieldName)) { + List coding = reader.readArray(reader1 -> FhirR4Coding.fromJson(reader1)); + deserializedFhirR4CodeableConcept.coding = coding; + } else if ("text".equals(fieldName)) { + deserializedFhirR4CodeableConcept.text = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4CodeableConcept; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Coding.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Coding.java index b12b4a55fbcd5..59931a457620c 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Coding.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Coding.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,28 +22,24 @@ public final class FhirR4Coding extends FhirR4Element { * Identity of the terminology system */ @Generated - @JsonProperty(value = "system") private String system; /* * Version of the system - if relevant */ @Generated - @JsonProperty(value = "version") private String version; /* * Symbol in syntax defined by the system */ @Generated - @JsonProperty(value = "code") private String code; /* * Representation defined by the system */ @Generated - @JsonProperty(value = "display") private String display; /** @@ -157,4 +156,56 @@ public FhirR4Coding setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("system", this.system); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Coding from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Coding if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Coding. + */ + @Generated + public static FhirR4Coding fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Coding deserializedFhirR4Coding = new FhirR4Coding(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Coding.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Coding.setExtension(extension); + } else if ("system".equals(fieldName)) { + deserializedFhirR4Coding.system = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedFhirR4Coding.version = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedFhirR4Coding.code = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedFhirR4Coding.display = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Coding; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Condition.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Condition.java index 52a3052999099..317f597d212ac 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Condition.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Condition.java @@ -5,23 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * Detailed information about conditions, problems or diagnoses * Based on [FHIR Condition](https://www.hl7.org/fhir/R4/condition.html). */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "resourceType", - defaultImpl = FhirR4Condition.class, - visible = true) -@JsonTypeName("Condition") @Immutable public final class FhirR4Condition extends FhirR4DomainResource { @@ -29,155 +24,132 @@ public final class FhirR4Condition extends FhirR4DomainResource { * Discriminator property for Fhir_R4_DomainResource. */ @Generated - @JsonTypeId - @JsonProperty(value = "resourceType") private String resourceType = "Condition"; /* * External Ids for this condition */ @Generated - @JsonProperty(value = "identifier") private List identifier; /* * active | recurrence | relapse | inactive | remission | resolved */ @Generated - @JsonProperty(value = "clinicalStatus") private FhirR4CodeableConcept clinicalStatus; /* * unconfirmed | provisional | differential | confirmed | refuted | entered-in-error */ @Generated - @JsonProperty(value = "verificationStatus") private FhirR4CodeableConcept verificationStatus; /* * problem-list-item | encounter-diagnosis */ @Generated - @JsonProperty(value = "category") private List category; /* * Subjective severity of condition */ @Generated - @JsonProperty(value = "severity") private FhirR4CodeableConcept severity; /* * Identification of the condition, problem or diagnosis */ @Generated - @JsonProperty(value = "code") private FhirR4CodeableConcept code; /* * Anatomical location, if relevant */ @Generated - @JsonProperty(value = "bodySite") private List bodySite; /* * Encounter created as part of */ @Generated - @JsonProperty(value = "encounter") private FhirR4Reference encounter; /* * Estimated or actual date, date-time, or age */ @Generated - @JsonProperty(value = "onsetDateTime") private String onsetDateTime; /* * Estimated or actual date, date-time, or age */ @Generated - @JsonProperty(value = "onsetAge") private FhirR4Quantity onsetAge; /* * Estimated or actual date, date-time, or age */ @Generated - @JsonProperty(value = "onsetPeriod") private FhirR4Period onsetPeriod; /* * Estimated or actual date, date-time, or age */ @Generated - @JsonProperty(value = "onsetRange") private FhirR4Range onsetRange; /* * Estimated or actual date, date-time, or age */ @Generated - @JsonProperty(value = "onsetString") private String onsetString; /* * When in resolution/remission */ @Generated - @JsonProperty(value = "abatementDateTime") private String abatementDateTime; /* * When in resolution/remission */ @Generated - @JsonProperty(value = "abatementAge") private FhirR4Quantity abatementAge; /* * When in resolution/remission */ @Generated - @JsonProperty(value = "abatementPeriod") private FhirR4Period abatementPeriod; /* * When in resolution/remission */ @Generated - @JsonProperty(value = "abatementRange") private FhirR4Range abatementRange; /* * When in resolution/remission */ @Generated - @JsonProperty(value = "abatementString") private String abatementString; /* * Date record was first recorded */ @Generated - @JsonProperty(value = "recordedDate") private String recordedDate; /* * stge/grade, usually assessed formally */ @Generated - @JsonProperty(value = "stage") private List stage; /* * Additional information about the Condition */ @Generated - @JsonProperty(value = "note") private List note; /** @@ -186,8 +158,7 @@ public final class FhirR4Condition extends FhirR4DomainResource { * @param resourceType the resourceType value to set. */ @Generated - @JsonCreator - private FhirR4Condition(@JsonProperty(value = "resourceType") String resourceType) { + private FhirR4Condition(String resourceType) { super(resourceType); } @@ -412,4 +383,267 @@ public List getStage() { public List getNote() { return this.note; } + + /* + * Extensions that cannot be ignored + */ + @Generated + private List modifierExtension; + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /* + * Contained, inline Resources + */ + @Generated + private List contained; + + /* + * Text summary of the resource, for human interpretation + */ + @Generated + private FhirR4Narrative text; + + /** + * Get the modifierExtension property: Extensions that cannot be ignored. + * + * @return the modifierExtension value. + */ + @Generated + @Override + public List getModifierExtension() { + return this.modifierExtension; + } + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * Get the contained property: Contained, inline Resources. + * + * @return the contained value. + */ + @Generated + @Override + public List getContained() { + return this.contained; + } + + /** + * Get the text property: Text summary of the resource, for human interpretation. + * + * @return the text value. + */ + @Generated + @Override + public FhirR4Narrative getText() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeJsonField("meta", getMeta()); + jsonWriter.writeStringField("implicitRules", getImplicitRules()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("text", getText()); + jsonWriter.writeArrayField("contained", getContained(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("modifierExtension", getModifierExtension(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeArrayField("identifier", this.identifier, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("clinicalStatus", this.clinicalStatus); + jsonWriter.writeJsonField("verificationStatus", this.verificationStatus); + jsonWriter.writeArrayField("category", this.category, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("severity", this.severity); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeArrayField("bodySite", this.bodySite, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("encounter", this.encounter); + jsonWriter.writeStringField("onsetDateTime", this.onsetDateTime); + jsonWriter.writeJsonField("onsetAge", this.onsetAge); + jsonWriter.writeJsonField("onsetPeriod", this.onsetPeriod); + jsonWriter.writeJsonField("onsetRange", this.onsetRange); + jsonWriter.writeStringField("onsetString", this.onsetString); + jsonWriter.writeStringField("abatementDateTime", this.abatementDateTime); + jsonWriter.writeJsonField("abatementAge", this.abatementAge); + jsonWriter.writeJsonField("abatementPeriod", this.abatementPeriod); + jsonWriter.writeJsonField("abatementRange", this.abatementRange); + jsonWriter.writeStringField("abatementString", this.abatementString); + jsonWriter.writeStringField("recordedDate", this.recordedDate); + jsonWriter.writeArrayField("stage", this.stage, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("note", this.note, (writer, element) -> writer.writeJson(element)); + if (getAdditionalProperties() != null) { + for (Map.Entry additionalProperty : getAdditionalProperties().entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Condition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Condition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4Condition. + */ + @Generated + public static FhirR4Condition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + FhirR4Meta meta = null; + String implicitRules = null; + String language = null; + FhirR4Narrative text = null; + List contained = null; + List extension = null; + List modifierExtension = null; + String resourceType = "Condition"; + List identifier = null; + FhirR4CodeableConcept clinicalStatus = null; + FhirR4CodeableConcept verificationStatus = null; + List category = null; + FhirR4CodeableConcept severity = null; + FhirR4CodeableConcept code = null; + List bodySite = null; + FhirR4Reference encounter = null; + String onsetDateTime = null; + FhirR4Quantity onsetAge = null; + FhirR4Period onsetPeriod = null; + FhirR4Range onsetRange = null; + String onsetString = null; + String abatementDateTime = null; + FhirR4Quantity abatementAge = null; + FhirR4Period abatementPeriod = null; + FhirR4Range abatementRange = null; + String abatementString = null; + String recordedDate = null; + List stage = null; + List note = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("meta".equals(fieldName)) { + meta = FhirR4Meta.fromJson(reader); + } else if ("implicitRules".equals(fieldName)) { + implicitRules = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("text".equals(fieldName)) { + text = FhirR4Narrative.fromJson(reader); + } else if ("contained".equals(fieldName)) { + contained = reader.readArray(reader1 -> FhirR4Resource.fromJson(reader1)); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("modifierExtension".equals(fieldName)) { + modifierExtension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("resourceType".equals(fieldName)) { + resourceType = reader.getString(); + } else if ("identifier".equals(fieldName)) { + identifier = reader.readArray(reader1 -> FhirR4Identifier.fromJson(reader1)); + } else if ("clinicalStatus".equals(fieldName)) { + clinicalStatus = FhirR4CodeableConcept.fromJson(reader); + } else if ("verificationStatus".equals(fieldName)) { + verificationStatus = FhirR4CodeableConcept.fromJson(reader); + } else if ("category".equals(fieldName)) { + category = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("severity".equals(fieldName)) { + severity = FhirR4CodeableConcept.fromJson(reader); + } else if ("code".equals(fieldName)) { + code = FhirR4CodeableConcept.fromJson(reader); + } else if ("bodySite".equals(fieldName)) { + bodySite = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("encounter".equals(fieldName)) { + encounter = FhirR4Reference.fromJson(reader); + } else if ("onsetDateTime".equals(fieldName)) { + onsetDateTime = reader.getString(); + } else if ("onsetAge".equals(fieldName)) { + onsetAge = FhirR4Quantity.fromJson(reader); + } else if ("onsetPeriod".equals(fieldName)) { + onsetPeriod = FhirR4Period.fromJson(reader); + } else if ("onsetRange".equals(fieldName)) { + onsetRange = FhirR4Range.fromJson(reader); + } else if ("onsetString".equals(fieldName)) { + onsetString = reader.getString(); + } else if ("abatementDateTime".equals(fieldName)) { + abatementDateTime = reader.getString(); + } else if ("abatementAge".equals(fieldName)) { + abatementAge = FhirR4Quantity.fromJson(reader); + } else if ("abatementPeriod".equals(fieldName)) { + abatementPeriod = FhirR4Period.fromJson(reader); + } else if ("abatementRange".equals(fieldName)) { + abatementRange = FhirR4Range.fromJson(reader); + } else if ("abatementString".equals(fieldName)) { + abatementString = reader.getString(); + } else if ("recordedDate".equals(fieldName)) { + recordedDate = reader.getString(); + } else if ("stage".equals(fieldName)) { + stage = reader.readArray(reader1 -> FhirR4ConditionStage.fromJson(reader1)); + } else if ("note".equals(fieldName)) { + note = reader.readArray(reader1 -> FhirR4Annotation.fromJson(reader1)); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + FhirR4Condition deserializedFhirR4Condition = new FhirR4Condition(resourceType); + deserializedFhirR4Condition.setId(id); + deserializedFhirR4Condition.setMeta(meta); + deserializedFhirR4Condition.setImplicitRules(implicitRules); + deserializedFhirR4Condition.setLanguage(language); + deserializedFhirR4Condition.text = text; + deserializedFhirR4Condition.contained = contained; + deserializedFhirR4Condition.extension = extension; + deserializedFhirR4Condition.modifierExtension = modifierExtension; + deserializedFhirR4Condition.resourceType = resourceType; + deserializedFhirR4Condition.identifier = identifier; + deserializedFhirR4Condition.clinicalStatus = clinicalStatus; + deserializedFhirR4Condition.verificationStatus = verificationStatus; + deserializedFhirR4Condition.category = category; + deserializedFhirR4Condition.severity = severity; + deserializedFhirR4Condition.code = code; + deserializedFhirR4Condition.bodySite = bodySite; + deserializedFhirR4Condition.encounter = encounter; + deserializedFhirR4Condition.onsetDateTime = onsetDateTime; + deserializedFhirR4Condition.onsetAge = onsetAge; + deserializedFhirR4Condition.onsetPeriod = onsetPeriod; + deserializedFhirR4Condition.onsetRange = onsetRange; + deserializedFhirR4Condition.onsetString = onsetString; + deserializedFhirR4Condition.abatementDateTime = abatementDateTime; + deserializedFhirR4Condition.abatementAge = abatementAge; + deserializedFhirR4Condition.abatementPeriod = abatementPeriod; + deserializedFhirR4Condition.abatementRange = abatementRange; + deserializedFhirR4Condition.abatementString = abatementString; + deserializedFhirR4Condition.recordedDate = recordedDate; + deserializedFhirR4Condition.stage = stage; + deserializedFhirR4Condition.note = note; + deserializedFhirR4Condition.setAdditionalProperties(additionalProperties); + return deserializedFhirR4Condition; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ConditionStage.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ConditionStage.java index 76543bcbd670d..ba066ea0148b4 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ConditionStage.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ConditionStage.java @@ -5,27 +5,29 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Stage/grade, usually assessed formally * Based on [FHIR Condition.Stage](https://www.hl7.org/fhir/R4/condition.html). */ @Immutable -public final class FhirR4ConditionStage { +public final class FhirR4ConditionStage implements JsonSerializable { /* * Simple summary (disease specific) */ @Generated - @JsonProperty(value = "summary") private FhirR4CodeableConcept summary; /* * Kind of staging */ @Generated - @JsonProperty(value = "type") private FhirR4CodeableConcept type; /** @@ -54,4 +56,43 @@ public FhirR4CodeableConcept getSummary() { public FhirR4CodeableConcept getType() { return this.type; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("summary", this.summary); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4ConditionStage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4ConditionStage if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4ConditionStage. + */ + @Generated + public static FhirR4ConditionStage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4ConditionStage deserializedFhirR4ConditionStage = new FhirR4ConditionStage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("summary".equals(fieldName)) { + deserializedFhirR4ConditionStage.summary = FhirR4CodeableConcept.fromJson(reader); + } else if ("type".equals(fieldName)) { + deserializedFhirR4ConditionStage.type = FhirR4CodeableConcept.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4ConditionStage; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactDetail.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactDetail.java index fcf6e1950ca38..2ab04bb023b38 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactDetail.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactDetail.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -18,14 +21,12 @@ public final class FhirR4ContactDetail extends FhirR4Element { * Name of an individual to contact */ @Generated - @JsonProperty(value = "name") private String name; /* * Contact details for individual or organization */ @Generated - @JsonProperty(value = "telecom") private List telecom; /** @@ -54,4 +55,52 @@ public String getName() { public List getTelecom() { return this.telecom; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("telecom", this.telecom, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4ContactDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4ContactDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4ContactDetail. + */ + @Generated + public static FhirR4ContactDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4ContactDetail deserializedFhirR4ContactDetail = new FhirR4ContactDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4ContactDetail.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4ContactDetail.setExtension(extension); + } else if ("name".equals(fieldName)) { + deserializedFhirR4ContactDetail.name = reader.getString(); + } else if ("telecom".equals(fieldName)) { + List telecom + = reader.readArray(reader1 -> FhirR4ContactPoint.fromJson(reader1)); + deserializedFhirR4ContactDetail.telecom = telecom; + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4ContactDetail; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactPoint.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactPoint.java index 803691d53cd93..1d6f35cab45f1 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactPoint.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ContactPoint.java @@ -5,7 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, @@ -13,41 +17,36 @@ * See https://www.hl7.org/fhir/R4/datatypes.html#ContactPoint. */ @Immutable -public final class FhirR4ContactPoint { +public final class FhirR4ContactPoint implements JsonSerializable { /* * phone | fax | email | pager | url | sms | other */ @Generated - @JsonProperty(value = "system") private ContactPointSystem system; /* * The actual contact point details */ @Generated - @JsonProperty(value = "value") private String value; /* * home | work | temp | old | mobile - purpose of this contact point */ @Generated - @JsonProperty(value = "use") private ContactPointUse use; /* * Specify preferred order of use (1 = highest) */ @Generated - @JsonProperty(value = "rank") private Integer rank; /* * Time period when the contact point was/is in use */ @Generated - @JsonProperty(value = "period") private FhirR4Period period; /** @@ -106,4 +105,52 @@ public Integer getRank() { public FhirR4Period getPeriod() { return this.period; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("system", this.system == null ? null : this.system.toString()); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("use", this.use == null ? null : this.use.toString()); + jsonWriter.writeNumberField("rank", this.rank); + jsonWriter.writeJsonField("period", this.period); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4ContactPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4ContactPoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4ContactPoint. + */ + @Generated + public static FhirR4ContactPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4ContactPoint deserializedFhirR4ContactPoint = new FhirR4ContactPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("system".equals(fieldName)) { + deserializedFhirR4ContactPoint.system = ContactPointSystem.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedFhirR4ContactPoint.value = reader.getString(); + } else if ("use".equals(fieldName)) { + deserializedFhirR4ContactPoint.use = ContactPointUse.fromString(reader.getString()); + } else if ("rank".equals(fieldName)) { + deserializedFhirR4ContactPoint.rank = reader.getNullable(JsonReader::getInt); + } else if ("period".equals(fieldName)) { + deserializedFhirR4ContactPoint.period = FhirR4Period.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4ContactPoint; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4DomainResource.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4DomainResource.java index 859307b2a09fe..aa152cfe48ba8 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4DomainResource.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4DomainResource.java @@ -5,28 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * A resource with narrative, extensions, and contained resources * Based on [FHIR DomainResource](https://www.hl7.org/fhir/domainresource.html). */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "resourceType", - defaultImpl = FhirR4DomainResource.class, - visible = true) -@JsonTypeName("Fhir_R4_DomainResource") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Condition", value = FhirR4Condition.class), - @JsonSubTypes.Type(name = "ResearchStudy", value = FhirR4ResearchStudy.class), - @JsonSubTypes.Type(name = "Observation", value = FhirR4Observation.class) }) @Immutable public class FhirR4DomainResource extends FhirR4Resource { @@ -34,36 +24,30 @@ public class FhirR4DomainResource extends FhirR4Resource { * Discriminator property for Fhir_R4_DomainResource. */ @Generated - @JsonTypeId - @JsonProperty(value = "resourceType") private String resourceType = "Fhir_R4_DomainResource"; /* * Text summary of the resource, for human interpretation */ @Generated - @JsonProperty(value = "text") private FhirR4Narrative text; /* * Contained, inline Resources */ @Generated - @JsonProperty(value = "contained") private List contained; /* * Additional Content defined by implementations */ @Generated - @JsonProperty(value = "extension") private List extension; /* * Extensions that cannot be ignored */ @Generated - @JsonProperty(value = "modifierExtension") private List modifierExtension; /** @@ -72,8 +56,7 @@ public class FhirR4DomainResource extends FhirR4Resource { * @param resourceType the resourceType value to set. */ @Generated - @JsonCreator - protected FhirR4DomainResource(@JsonProperty(value = "resourceType") String resourceType) { + protected FhirR4DomainResource(String resourceType) { super(resourceType); } @@ -127,4 +110,173 @@ public List getExtension() { public List getModifierExtension() { return this.modifierExtension; } + + /** + * Set the text property: Text summary of the resource, for human interpretation. + * + * @param text the text value to set. + * @return the FhirR4DomainResource object itself. + */ + @Generated + FhirR4DomainResource setText(FhirR4Narrative text) { + this.text = text; + return this; + } + + /** + * Set the contained property: Contained, inline Resources. + * + * @param contained the contained value to set. + * @return the FhirR4DomainResource object itself. + */ + @Generated + FhirR4DomainResource setContained(List contained) { + this.contained = contained; + return this; + } + + /** + * Set the extension property: Additional Content defined by implementations. + * + * @param extension the extension value to set. + * @return the FhirR4DomainResource object itself. + */ + @Generated + FhirR4DomainResource setExtension(List extension) { + this.extension = extension; + return this; + } + + /** + * Set the modifierExtension property: Extensions that cannot be ignored. + * + * @param modifierExtension the modifierExtension value to set. + * @return the FhirR4DomainResource object itself. + */ + @Generated + FhirR4DomainResource setModifierExtension(List modifierExtension) { + this.modifierExtension = modifierExtension; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeJsonField("meta", getMeta()); + jsonWriter.writeStringField("implicitRules", getImplicitRules()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeJsonField("text", this.text); + jsonWriter.writeArrayField("contained", this.contained, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extension", this.extension, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("modifierExtension", this.modifierExtension, + (writer, element) -> writer.writeJson(element)); + if (getAdditionalProperties() != null) { + for (Map.Entry additionalProperty : getAdditionalProperties().entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4DomainResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4DomainResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4DomainResource. + */ + @Generated + public static FhirR4DomainResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resourceType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Condition".equals(discriminatorValue)) { + return FhirR4Condition.fromJson(readerToUse.reset()); + } else if ("ResearchStudy".equals(discriminatorValue)) { + return FhirR4ResearchStudy.fromJson(readerToUse.reset()); + } else if ("Observation".equals(discriminatorValue)) { + return FhirR4Observation.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static FhirR4DomainResource fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + FhirR4Meta meta = null; + String implicitRules = null; + String language = null; + String resourceType = null; + FhirR4Narrative text = null; + List contained = null; + List extension = null; + List modifierExtension = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("meta".equals(fieldName)) { + meta = FhirR4Meta.fromJson(reader); + } else if ("implicitRules".equals(fieldName)) { + implicitRules = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + resourceType = reader.getString(); + } else if ("text".equals(fieldName)) { + text = FhirR4Narrative.fromJson(reader); + } else if ("contained".equals(fieldName)) { + contained = reader.readArray(reader1 -> FhirR4Resource.fromJson(reader1)); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("modifierExtension".equals(fieldName)) { + modifierExtension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + FhirR4DomainResource deserializedFhirR4DomainResource = new FhirR4DomainResource(resourceType); + deserializedFhirR4DomainResource.setId(id); + deserializedFhirR4DomainResource.setMeta(meta); + deserializedFhirR4DomainResource.setImplicitRules(implicitRules); + deserializedFhirR4DomainResource.setLanguage(language); + deserializedFhirR4DomainResource.resourceType = resourceType; + deserializedFhirR4DomainResource.text = text; + deserializedFhirR4DomainResource.contained = contained; + deserializedFhirR4DomainResource.extension = extension; + deserializedFhirR4DomainResource.modifierExtension = modifierExtension; + deserializedFhirR4DomainResource.setAdditionalProperties(additionalProperties); + return deserializedFhirR4DomainResource; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Element.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Element.java index 00c9ad7557121..a58e998547434 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Element.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Element.java @@ -5,7 +5,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,20 +17,18 @@ * Based on [FHIR Element](https://www.hl7.org/fhir/R4/element.html). */ @Fluent -public class FhirR4Element { +public class FhirR4Element implements JsonSerializable { /* * Unique id for inter-element referencing */ @Generated - @JsonProperty(value = "id") private String id; /* * Additional Content defined by implementations */ @Generated - @JsonProperty(value = "extension") private List extension; /** @@ -79,4 +81,44 @@ public FhirR4Element setExtension(List extension) { this.extension = extension; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("extension", this.extension, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Element from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Element if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Element. + */ + @Generated + public static FhirR4Element fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Element deserializedFhirR4Element = new FhirR4Element(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Element.id = reader.getString(); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Element.extension = extension; + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Element; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Extension.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Extension.java index 762e5c12cf55a..08e858e332a6d 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Extension.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Extension.java @@ -5,13 +5,15 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Base for all elements - * Based on [FHIR Element](https://www.hl7.org/fhir/datatypes.html#Element). + * Based on [FHIR Element](https://www.hl7.org/fhir/R4/element.html). */ @Fluent public final class FhirR4Extension extends FhirR4Element { @@ -20,91 +22,78 @@ public final class FhirR4Extension extends FhirR4Element { * Source of the definition for the extension code - a logical name or a URL. */ @Generated - @JsonProperty(value = "url") private final String url; /* * Value as Quantity */ @Generated - @JsonProperty(value = "valueQuantity") private FhirR4Quantity valueQuantity; /* * Value as CodeableConcept */ @Generated - @JsonProperty(value = "valueCodeableConcept") private FhirR4CodeableConcept valueCodeableConcept; /* * Value as string */ @Generated - @JsonProperty(value = "valueString") private String valueString; /* * Value as boolean */ @Generated - @JsonProperty(value = "valueBoolean") private Boolean valueBoolean; /* * Value as integer */ @Generated - @JsonProperty(value = "valueInteger") private Integer valueInteger; /* * Value as Range. */ @Generated - @JsonProperty(value = "valueRange") private FhirR4Range valueRange; /* * Value as Ratio. */ @Generated - @JsonProperty(value = "valueRatio") private FhirR4Ratio valueRatio; /* * Value as SampledData. */ @Generated - @JsonProperty(value = "valueSampledData") private FhirR4SampledData valueSampledData; /* * Value as time (hh:mm:ss) */ @Generated - @JsonProperty(value = "valueTime") private String valueTime; /* * Value as dateTime. */ @Generated - @JsonProperty(value = "valueDateTime") private String valueDateTime; /* * Value as Period. */ @Generated - @JsonProperty(value = "valuePeriod") private FhirR4Period valuePeriod; /* * Value as reference. */ @Generated - @JsonProperty(value = "valueReference") private FhirR4Reference valueReference; /** @@ -113,8 +102,7 @@ public final class FhirR4Extension extends FhirR4Element { * @param url the url value to set. */ @Generated - @JsonCreator - public FhirR4Extension(@JsonProperty(value = "url") String url) { + public FhirR4Extension(String url) { this.url = url; } @@ -411,4 +399,112 @@ public FhirR4Extension setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeJsonField("valueQuantity", this.valueQuantity); + jsonWriter.writeJsonField("valueCodeableConcept", this.valueCodeableConcept); + jsonWriter.writeStringField("valueString", this.valueString); + jsonWriter.writeBooleanField("valueBoolean", this.valueBoolean); + jsonWriter.writeNumberField("valueInteger", this.valueInteger); + jsonWriter.writeJsonField("valueRange", this.valueRange); + jsonWriter.writeJsonField("valueRatio", this.valueRatio); + jsonWriter.writeJsonField("valueSampledData", this.valueSampledData); + jsonWriter.writeStringField("valueTime", this.valueTime); + jsonWriter.writeStringField("valueDateTime", this.valueDateTime); + jsonWriter.writeJsonField("valuePeriod", this.valuePeriod); + jsonWriter.writeJsonField("valueReference", this.valueReference); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Extension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Extension if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4Extension. + */ + @Generated + public static FhirR4Extension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + List extension = null; + String url = null; + FhirR4Quantity valueQuantity = null; + FhirR4CodeableConcept valueCodeableConcept = null; + String valueString = null; + Boolean valueBoolean = null; + Integer valueInteger = null; + FhirR4Range valueRange = null; + FhirR4Ratio valueRatio = null; + FhirR4SampledData valueSampledData = null; + String valueTime = null; + String valueDateTime = null; + FhirR4Period valuePeriod = null; + FhirR4Reference valueReference = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("url".equals(fieldName)) { + url = reader.getString(); + } else if ("valueQuantity".equals(fieldName)) { + valueQuantity = FhirR4Quantity.fromJson(reader); + } else if ("valueCodeableConcept".equals(fieldName)) { + valueCodeableConcept = FhirR4CodeableConcept.fromJson(reader); + } else if ("valueString".equals(fieldName)) { + valueString = reader.getString(); + } else if ("valueBoolean".equals(fieldName)) { + valueBoolean = reader.getNullable(JsonReader::getBoolean); + } else if ("valueInteger".equals(fieldName)) { + valueInteger = reader.getNullable(JsonReader::getInt); + } else if ("valueRange".equals(fieldName)) { + valueRange = FhirR4Range.fromJson(reader); + } else if ("valueRatio".equals(fieldName)) { + valueRatio = FhirR4Ratio.fromJson(reader); + } else if ("valueSampledData".equals(fieldName)) { + valueSampledData = FhirR4SampledData.fromJson(reader); + } else if ("valueTime".equals(fieldName)) { + valueTime = reader.getString(); + } else if ("valueDateTime".equals(fieldName)) { + valueDateTime = reader.getString(); + } else if ("valuePeriod".equals(fieldName)) { + valuePeriod = FhirR4Period.fromJson(reader); + } else if ("valueReference".equals(fieldName)) { + valueReference = FhirR4Reference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + FhirR4Extension deserializedFhirR4Extension = new FhirR4Extension(url); + deserializedFhirR4Extension.setId(id); + deserializedFhirR4Extension.setExtension(extension); + deserializedFhirR4Extension.valueQuantity = valueQuantity; + deserializedFhirR4Extension.valueCodeableConcept = valueCodeableConcept; + deserializedFhirR4Extension.valueString = valueString; + deserializedFhirR4Extension.valueBoolean = valueBoolean; + deserializedFhirR4Extension.valueInteger = valueInteger; + deserializedFhirR4Extension.valueRange = valueRange; + deserializedFhirR4Extension.valueRatio = valueRatio; + deserializedFhirR4Extension.valueSampledData = valueSampledData; + deserializedFhirR4Extension.valueTime = valueTime; + deserializedFhirR4Extension.valueDateTime = valueDateTime; + deserializedFhirR4Extension.valuePeriod = valuePeriod; + deserializedFhirR4Extension.valueReference = valueReference; + return deserializedFhirR4Extension; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Identifier.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Identifier.java index 6040463313e6e..46583ee59964e 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Identifier.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Identifier.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,42 +22,36 @@ public final class FhirR4Identifier extends FhirR4Element { * usual | official | temp | secondary | old (If known) */ @Generated - @JsonProperty(value = "use") private String use; /* * Description of identifier */ @Generated - @JsonProperty(value = "type") private FhirR4CodeableConcept type; /* * The namespace for the identifier value */ @Generated - @JsonProperty(value = "system") private String system; /* * The value that is unique */ @Generated - @JsonProperty(value = "value") private String value; /* * Time period when id is/was valid for use */ @Generated - @JsonProperty(value = "period") private FhirR4Period period; /* * Organization that issued id (may be just text) */ @Generated - @JsonProperty(value = "assigner") private FhirR4Reference assigner; /** @@ -215,4 +212,62 @@ public FhirR4Identifier setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("use", this.use); + jsonWriter.writeJsonField("type", this.type); + jsonWriter.writeStringField("system", this.system); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeJsonField("period", this.period); + jsonWriter.writeJsonField("assigner", this.assigner); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Identifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Identifier if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Identifier. + */ + @Generated + public static FhirR4Identifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Identifier deserializedFhirR4Identifier = new FhirR4Identifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Identifier.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Identifier.setExtension(extension); + } else if ("use".equals(fieldName)) { + deserializedFhirR4Identifier.use = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFhirR4Identifier.type = FhirR4CodeableConcept.fromJson(reader); + } else if ("system".equals(fieldName)) { + deserializedFhirR4Identifier.system = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedFhirR4Identifier.value = reader.getString(); + } else if ("period".equals(fieldName)) { + deserializedFhirR4Identifier.period = FhirR4Period.fromJson(reader); + } else if ("assigner".equals(fieldName)) { + deserializedFhirR4Identifier.assigner = FhirR4Reference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Identifier; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Meta.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Meta.java index e804f55701ae7..271acb1f3bbcd 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Meta.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Meta.java @@ -5,7 +5,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,21 +17,19 @@ * Based on [FHIR Meta](https://www.hl7.org/fhir/R4/resource.html#Meta). */ @Fluent -public final class FhirR4Meta { +public final class FhirR4Meta implements JsonSerializable { /* * 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. */ @Generated - @JsonProperty(value = "versionId") private String versionId; /* * When the resource last changed - e.g. when the version changed. */ @Generated - @JsonProperty(value = "lastUpdated") private String lastUpdated; /* @@ -36,7 +38,6 @@ public final class FhirR4Meta { * another FHIR server, document, message, database, etc. */ @Generated - @JsonProperty(value = "source") private String source; /* @@ -45,7 +46,6 @@ public final class FhirR4Meta { * [StructureDefinition.url](https://www.hl7.org/fhir/structuredefinition-definitions.html#StructureDefinition.url). */ @Generated - @JsonProperty(value = "profile") private List profile; /* @@ -53,7 +53,6 @@ public final class FhirR4Meta { * and infrastructure. */ @Generated - @JsonProperty(value = "security") private List security; /* @@ -61,7 +60,6 @@ public final class FhirR4Meta { * workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. */ @Generated - @JsonProperty(value = "tag") private List tag; /** @@ -220,4 +218,58 @@ public FhirR4Meta setTag(List tag) { this.tag = tag; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("versionId", this.versionId); + jsonWriter.writeStringField("lastUpdated", this.lastUpdated); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeArrayField("profile", this.profile, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("security", this.security, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tag", this.tag, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Meta from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Meta if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Meta. + */ + @Generated + public static FhirR4Meta fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Meta deserializedFhirR4Meta = new FhirR4Meta(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("versionId".equals(fieldName)) { + deserializedFhirR4Meta.versionId = reader.getString(); + } else if ("lastUpdated".equals(fieldName)) { + deserializedFhirR4Meta.lastUpdated = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedFhirR4Meta.source = reader.getString(); + } else if ("profile".equals(fieldName)) { + List profile = reader.readArray(reader1 -> reader1.getString()); + deserializedFhirR4Meta.profile = profile; + } else if ("security".equals(fieldName)) { + List security = reader.readArray(reader1 -> FhirR4Coding.fromJson(reader1)); + deserializedFhirR4Meta.security = security; + } else if ("tag".equals(fieldName)) { + List tag = reader.readArray(reader1 -> FhirR4Coding.fromJson(reader1)); + deserializedFhirR4Meta.tag = tag; + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Meta; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Narrative.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Narrative.java index 11ed00f679dd2..b6df6f590edcf 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Narrative.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Narrative.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * Any resource that is a [DomainResource](https://www.hl7.org/fhir/domainresource.html) may include a human-readable @@ -21,14 +24,12 @@ public final class FhirR4Narrative extends FhirR4Element { * generated, extensions, additional, empty */ @Generated - @JsonProperty(value = "status") private final String status; /* * xhtml */ @Generated - @JsonProperty(value = "div") private final String div; /** @@ -38,8 +39,7 @@ public final class FhirR4Narrative extends FhirR4Element { * @param div the div value to set. */ @Generated - @JsonCreator - private FhirR4Narrative(@JsonProperty(value = "status") String status, @JsonProperty(value = "div") String div) { + private FhirR4Narrative(String status, String div) { this.status = status; this.div = div; } @@ -63,4 +63,56 @@ public String getStatus() { public String getDiv() { return this.div; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("div", this.div); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Narrative from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Narrative if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4Narrative. + */ + @Generated + public static FhirR4Narrative fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + List extension = null; + String status = null; + String div = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("status".equals(fieldName)) { + status = reader.getString(); + } else if ("div".equals(fieldName)) { + div = reader.getString(); + } else { + reader.skipChildren(); + } + } + FhirR4Narrative deserializedFhirR4Narrative = new FhirR4Narrative(status, div); + deserializedFhirR4Narrative.setId(id); + deserializedFhirR4Narrative.setExtension(extension); + return deserializedFhirR4Narrative; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Observation.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Observation.java index ad3e1843b988e..4c7d3192f4f3b 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Observation.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Observation.java @@ -5,23 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * Detailed information about observations * Based on [FHIR Observation](https://www.hl7.org/fhir/R4/observation.html). */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "resourceType", - defaultImpl = FhirR4Observation.class, - visible = true) -@JsonTypeName("Observation") @Immutable public final class FhirR4Observation extends FhirR4DomainResource { @@ -29,218 +24,186 @@ public final class FhirR4Observation extends FhirR4DomainResource { * Discriminator property for Fhir_R4_DomainResource. */ @Generated - @JsonTypeId - @JsonProperty(value = "resourceType") private String resourceType = "Observation"; /* * Business Identifier for observation */ @Generated - @JsonProperty(value = "identifier") private List identifier; /* * registered | preliminary | final | amended + */ @Generated - @JsonProperty(value = "status") private final ObservationStatusCodeType status; /* * Classification of type of observation */ @Generated - @JsonProperty(value = "category") private List category; /* * Type of observation (code / type) */ @Generated - @JsonProperty(value = "code") private final FhirR4CodeableConcept code; /* * Who and/or what the observation is about */ @Generated - @JsonProperty(value = "subject") private FhirR4Reference subject; /* * Healthcare event during which this observation is made */ @Generated - @JsonProperty(value = "encounter") private FhirR4Reference encounter; /* * Clinically relevant time/time-period for observation */ @Generated - @JsonProperty(value = "effectiveDateTime") private String effectiveDateTime; /* * Clinically relevant time/time-period for observation */ @Generated - @JsonProperty(value = "effectivePeriod") private FhirR4Period effectivePeriod; /* * Clinically relevant time/time-period for observation */ @Generated - @JsonProperty(value = "effectiveInstant") private String effectiveInstant; /* * Date/Time this version was made available */ @Generated - @JsonProperty(value = "issued") private String issued; /* * Actual result */ @Generated - @JsonProperty(value = "valueQuantity") private FhirR4Quantity valueQuantity; /* * Actual result */ @Generated - @JsonProperty(value = "valueCodeableConcept") private FhirR4CodeableConcept valueCodeableConcept; /* * Actual result */ @Generated - @JsonProperty(value = "valueString") private String valueString; /* * Actual result */ @Generated - @JsonProperty(value = "valueBoolean") private Boolean valueBoolean; /* * Actual result */ @Generated - @JsonProperty(value = "valueInteger") private Integer valueInteger; /* * Actual result */ @Generated - @JsonProperty(value = "valueRange") private FhirR4Range valueRange; /* * Actual result */ @Generated - @JsonProperty(value = "valueRatio") private FhirR4Ratio valueRatio; /* * Actual result */ @Generated - @JsonProperty(value = "valueSampledData") private FhirR4SampledData valueSampledData; /* * Actual result */ @Generated - @JsonProperty(value = "valueTime") private String valueTime; /* * Actual result */ @Generated - @JsonProperty(value = "valueDateTime") private String valueDateTime; /* * Actual result */ @Generated - @JsonProperty(value = "valuePeriod") private FhirR4Period valuePeriod; /* * Why the result is missing */ @Generated - @JsonProperty(value = "dataAbsentReason") private FhirR4CodeableConcept dataAbsentReason; /* * High, low, normal, etc. */ @Generated - @JsonProperty(value = "interpretation") private List interpretation; /* * Comments about the observation */ @Generated - @JsonProperty(value = "note") private List note; /* * Observed body part */ @Generated - @JsonProperty(value = "bodySite") private FhirR4CodeableConcept bodySite; /* * How it was done */ @Generated - @JsonProperty(value = "method") private FhirR4CodeableConcept method; /* * Provides guide for interpretation */ @Generated - @JsonProperty(value = "referenceRange") private List referenceRange; /* * Related resource that belongs to the Observation group */ @Generated - @JsonProperty(value = "hasMember") private List hasMember; /* * Related measurements the observation is made from */ @Generated - @JsonProperty(value = "derivedFrom") private List derivedFrom; /* * Component results */ @Generated - @JsonProperty(value = "component") private List component; /** @@ -251,10 +214,7 @@ public final class FhirR4Observation extends FhirR4DomainResource { * @param code the code value to set. */ @Generated - @JsonCreator - private FhirR4Observation(@JsonProperty(value = "resourceType") String resourceType, - @JsonProperty(value = "status") ObservationStatusCodeType status, - @JsonProperty(value = "code") FhirR4CodeableConcept code) { + private FhirR4Observation(String resourceType, ObservationStatusCodeType status, FhirR4CodeableConcept code) { super(resourceType); this.status = status; this.code = code; @@ -570,4 +530,312 @@ public List getDerivedFrom() { public List getComponent() { return this.component; } + + /* + * Extensions that cannot be ignored + */ + @Generated + private List modifierExtension; + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /* + * Contained, inline Resources + */ + @Generated + private List contained; + + /* + * Text summary of the resource, for human interpretation + */ + @Generated + private FhirR4Narrative text; + + /** + * Get the modifierExtension property: Extensions that cannot be ignored. + * + * @return the modifierExtension value. + */ + @Generated + @Override + public List getModifierExtension() { + return this.modifierExtension; + } + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * Get the contained property: Contained, inline Resources. + * + * @return the contained value. + */ + @Generated + @Override + public List getContained() { + return this.contained; + } + + /** + * Get the text property: Text summary of the resource, for human interpretation. + * + * @return the text value. + */ + @Generated + @Override + public FhirR4Narrative getText() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeJsonField("meta", getMeta()); + jsonWriter.writeStringField("implicitRules", getImplicitRules()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("text", getText()); + jsonWriter.writeArrayField("contained", getContained(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("modifierExtension", getModifierExtension(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeArrayField("identifier", this.identifier, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("category", this.category, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("subject", this.subject); + jsonWriter.writeJsonField("encounter", this.encounter); + jsonWriter.writeStringField("effectiveDateTime", this.effectiveDateTime); + jsonWriter.writeJsonField("effectivePeriod", this.effectivePeriod); + jsonWriter.writeStringField("effectiveInstant", this.effectiveInstant); + jsonWriter.writeStringField("issued", this.issued); + jsonWriter.writeJsonField("valueQuantity", this.valueQuantity); + jsonWriter.writeJsonField("valueCodeableConcept", this.valueCodeableConcept); + jsonWriter.writeStringField("valueString", this.valueString); + jsonWriter.writeBooleanField("valueBoolean", this.valueBoolean); + jsonWriter.writeNumberField("valueInteger", this.valueInteger); + jsonWriter.writeJsonField("valueRange", this.valueRange); + jsonWriter.writeJsonField("valueRatio", this.valueRatio); + jsonWriter.writeJsonField("valueSampledData", this.valueSampledData); + jsonWriter.writeStringField("valueTime", this.valueTime); + jsonWriter.writeStringField("valueDateTime", this.valueDateTime); + jsonWriter.writeJsonField("valuePeriod", this.valuePeriod); + jsonWriter.writeJsonField("dataAbsentReason", this.dataAbsentReason); + jsonWriter.writeArrayField("interpretation", this.interpretation, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("note", this.note, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("bodySite", this.bodySite); + jsonWriter.writeJsonField("method", this.method); + jsonWriter.writeArrayField("referenceRange", this.referenceRange, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("hasMember", this.hasMember, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("derivedFrom", this.derivedFrom, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("component", this.component, (writer, element) -> writer.writeJson(element)); + if (getAdditionalProperties() != null) { + for (Map.Entry additionalProperty : getAdditionalProperties().entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Observation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Observation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4Observation. + */ + @Generated + public static FhirR4Observation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + FhirR4Meta meta = null; + String implicitRules = null; + String language = null; + FhirR4Narrative text = null; + List contained = null; + List extension = null; + List modifierExtension = null; + ObservationStatusCodeType status = null; + FhirR4CodeableConcept code = null; + String resourceType = "Observation"; + List identifier = null; + List category = null; + FhirR4Reference subject = null; + FhirR4Reference encounter = null; + String effectiveDateTime = null; + FhirR4Period effectivePeriod = null; + String effectiveInstant = null; + String issued = null; + FhirR4Quantity valueQuantity = null; + FhirR4CodeableConcept valueCodeableConcept = null; + String valueString = null; + Boolean valueBoolean = null; + Integer valueInteger = null; + FhirR4Range valueRange = null; + FhirR4Ratio valueRatio = null; + FhirR4SampledData valueSampledData = null; + String valueTime = null; + String valueDateTime = null; + FhirR4Period valuePeriod = null; + FhirR4CodeableConcept dataAbsentReason = null; + List interpretation = null; + List note = null; + FhirR4CodeableConcept bodySite = null; + FhirR4CodeableConcept method = null; + List referenceRange = null; + List hasMember = null; + List derivedFrom = null; + List component = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("meta".equals(fieldName)) { + meta = FhirR4Meta.fromJson(reader); + } else if ("implicitRules".equals(fieldName)) { + implicitRules = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("text".equals(fieldName)) { + text = FhirR4Narrative.fromJson(reader); + } else if ("contained".equals(fieldName)) { + contained = reader.readArray(reader1 -> FhirR4Resource.fromJson(reader1)); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("modifierExtension".equals(fieldName)) { + modifierExtension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("status".equals(fieldName)) { + status = ObservationStatusCodeType.fromString(reader.getString()); + } else if ("code".equals(fieldName)) { + code = FhirR4CodeableConcept.fromJson(reader); + } else if ("resourceType".equals(fieldName)) { + resourceType = reader.getString(); + } else if ("identifier".equals(fieldName)) { + identifier = reader.readArray(reader1 -> FhirR4Identifier.fromJson(reader1)); + } else if ("category".equals(fieldName)) { + category = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("subject".equals(fieldName)) { + subject = FhirR4Reference.fromJson(reader); + } else if ("encounter".equals(fieldName)) { + encounter = FhirR4Reference.fromJson(reader); + } else if ("effectiveDateTime".equals(fieldName)) { + effectiveDateTime = reader.getString(); + } else if ("effectivePeriod".equals(fieldName)) { + effectivePeriod = FhirR4Period.fromJson(reader); + } else if ("effectiveInstant".equals(fieldName)) { + effectiveInstant = reader.getString(); + } else if ("issued".equals(fieldName)) { + issued = reader.getString(); + } else if ("valueQuantity".equals(fieldName)) { + valueQuantity = FhirR4Quantity.fromJson(reader); + } else if ("valueCodeableConcept".equals(fieldName)) { + valueCodeableConcept = FhirR4CodeableConcept.fromJson(reader); + } else if ("valueString".equals(fieldName)) { + valueString = reader.getString(); + } else if ("valueBoolean".equals(fieldName)) { + valueBoolean = reader.getNullable(JsonReader::getBoolean); + } else if ("valueInteger".equals(fieldName)) { + valueInteger = reader.getNullable(JsonReader::getInt); + } else if ("valueRange".equals(fieldName)) { + valueRange = FhirR4Range.fromJson(reader); + } else if ("valueRatio".equals(fieldName)) { + valueRatio = FhirR4Ratio.fromJson(reader); + } else if ("valueSampledData".equals(fieldName)) { + valueSampledData = FhirR4SampledData.fromJson(reader); + } else if ("valueTime".equals(fieldName)) { + valueTime = reader.getString(); + } else if ("valueDateTime".equals(fieldName)) { + valueDateTime = reader.getString(); + } else if ("valuePeriod".equals(fieldName)) { + valuePeriod = FhirR4Period.fromJson(reader); + } else if ("dataAbsentReason".equals(fieldName)) { + dataAbsentReason = FhirR4CodeableConcept.fromJson(reader); + } else if ("interpretation".equals(fieldName)) { + interpretation = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("note".equals(fieldName)) { + note = reader.readArray(reader1 -> FhirR4Annotation.fromJson(reader1)); + } else if ("bodySite".equals(fieldName)) { + bodySite = FhirR4CodeableConcept.fromJson(reader); + } else if ("method".equals(fieldName)) { + method = FhirR4CodeableConcept.fromJson(reader); + } else if ("referenceRange".equals(fieldName)) { + referenceRange = reader.readArray(reader1 -> FhirR4ObservationReferenceRange.fromJson(reader1)); + } else if ("hasMember".equals(fieldName)) { + hasMember = reader.readArray(reader1 -> FhirR4Reference.fromJson(reader1)); + } else if ("derivedFrom".equals(fieldName)) { + derivedFrom = reader.readArray(reader1 -> FhirR4Reference.fromJson(reader1)); + } else if ("component".equals(fieldName)) { + component = reader.readArray(reader1 -> FhirR4ObservationComponent.fromJson(reader1)); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + FhirR4Observation deserializedFhirR4Observation = new FhirR4Observation(resourceType, status, code); + deserializedFhirR4Observation.setId(id); + deserializedFhirR4Observation.setMeta(meta); + deserializedFhirR4Observation.setImplicitRules(implicitRules); + deserializedFhirR4Observation.setLanguage(language); + deserializedFhirR4Observation.text = text; + deserializedFhirR4Observation.contained = contained; + deserializedFhirR4Observation.extension = extension; + deserializedFhirR4Observation.modifierExtension = modifierExtension; + deserializedFhirR4Observation.resourceType = resourceType; + deserializedFhirR4Observation.identifier = identifier; + deserializedFhirR4Observation.category = category; + deserializedFhirR4Observation.subject = subject; + deserializedFhirR4Observation.encounter = encounter; + deserializedFhirR4Observation.effectiveDateTime = effectiveDateTime; + deserializedFhirR4Observation.effectivePeriod = effectivePeriod; + deserializedFhirR4Observation.effectiveInstant = effectiveInstant; + deserializedFhirR4Observation.issued = issued; + deserializedFhirR4Observation.valueQuantity = valueQuantity; + deserializedFhirR4Observation.valueCodeableConcept = valueCodeableConcept; + deserializedFhirR4Observation.valueString = valueString; + deserializedFhirR4Observation.valueBoolean = valueBoolean; + deserializedFhirR4Observation.valueInteger = valueInteger; + deserializedFhirR4Observation.valueRange = valueRange; + deserializedFhirR4Observation.valueRatio = valueRatio; + deserializedFhirR4Observation.valueSampledData = valueSampledData; + deserializedFhirR4Observation.valueTime = valueTime; + deserializedFhirR4Observation.valueDateTime = valueDateTime; + deserializedFhirR4Observation.valuePeriod = valuePeriod; + deserializedFhirR4Observation.dataAbsentReason = dataAbsentReason; + deserializedFhirR4Observation.interpretation = interpretation; + deserializedFhirR4Observation.note = note; + deserializedFhirR4Observation.bodySite = bodySite; + deserializedFhirR4Observation.method = method; + deserializedFhirR4Observation.referenceRange = referenceRange; + deserializedFhirR4Observation.hasMember = hasMember; + deserializedFhirR4Observation.derivedFrom = derivedFrom; + deserializedFhirR4Observation.component = component; + deserializedFhirR4Observation.setAdditionalProperties(additionalProperties); + return deserializedFhirR4Observation; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationComponent.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationComponent.java index c030b2aa6086a..ac97a9202f423 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationComponent.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationComponent.java @@ -5,8 +5,10 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -20,112 +22,96 @@ public final class FhirR4ObservationComponent extends FhirR4Element { * Type of component observation (code / type) */ @Generated - @JsonProperty(value = "code") private final FhirR4CodeableConcept code; /* * Value as Quantity */ @Generated - @JsonProperty(value = "valueQuantity") private FhirR4Quantity valueQuantity; /* * Value as CodeableConcept */ @Generated - @JsonProperty(value = "valueCodeableConcept") private FhirR4CodeableConcept valueCodeableConcept; /* * Value as string */ @Generated - @JsonProperty(value = "valueString") private String valueString; /* * Value as boolean */ @Generated - @JsonProperty(value = "valueBoolean") private Boolean valueBoolean; /* * Value as integer */ @Generated - @JsonProperty(value = "valueInteger") private Integer valueInteger; /* * Value as Range. */ @Generated - @JsonProperty(value = "valueRange") private FhirR4Range valueRange; /* * Value as Ratio. */ @Generated - @JsonProperty(value = "valueRatio") private FhirR4Ratio valueRatio; /* * Value as SampledData. */ @Generated - @JsonProperty(value = "valueSampledData") private FhirR4SampledData valueSampledData; /* * Value as time (hh:mm:ss) */ @Generated - @JsonProperty(value = "valueTime") private String valueTime; /* * Value as dateTime. */ @Generated - @JsonProperty(value = "valueDateTime") private String valueDateTime; /* * Value as Period. */ @Generated - @JsonProperty(value = "valuePeriod") private FhirR4Period valuePeriod; /* * Value as reference. */ @Generated - @JsonProperty(value = "valueReference") private FhirR4Reference valueReference; /* * Why the component result is missing */ @Generated - @JsonProperty(value = "dataAbsentReason") private FhirR4CodeableConcept dataAbsentReason; /* * High, low, normal, etc. */ @Generated - @JsonProperty(value = "interpretation") private List interpretation; /* * Provides guide for interpretation of component result */ @Generated - @JsonProperty(value = "referenceRange") private List referenceRange; /** @@ -134,8 +120,7 @@ public final class FhirR4ObservationComponent extends FhirR4Element { * @param code the code value to set. */ @Generated - @JsonCreator - private FhirR4ObservationComponent(@JsonProperty(value = "code") FhirR4CodeableConcept code) { + private FhirR4ObservationComponent(FhirR4CodeableConcept code) { this.code = code; } @@ -298,4 +283,129 @@ public List getInterpretation() { public List getReferenceRange() { return this.referenceRange; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeJsonField("valueQuantity", this.valueQuantity); + jsonWriter.writeJsonField("valueCodeableConcept", this.valueCodeableConcept); + jsonWriter.writeStringField("valueString", this.valueString); + jsonWriter.writeBooleanField("valueBoolean", this.valueBoolean); + jsonWriter.writeNumberField("valueInteger", this.valueInteger); + jsonWriter.writeJsonField("valueRange", this.valueRange); + jsonWriter.writeJsonField("valueRatio", this.valueRatio); + jsonWriter.writeJsonField("valueSampledData", this.valueSampledData); + jsonWriter.writeStringField("valueTime", this.valueTime); + jsonWriter.writeStringField("valueDateTime", this.valueDateTime); + jsonWriter.writeJsonField("valuePeriod", this.valuePeriod); + jsonWriter.writeJsonField("valueReference", this.valueReference); + jsonWriter.writeJsonField("dataAbsentReason", this.dataAbsentReason); + jsonWriter.writeArrayField("interpretation", this.interpretation, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("referenceRange", this.referenceRange, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4ObservationComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4ObservationComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4ObservationComponent. + */ + @Generated + public static FhirR4ObservationComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + List extension = null; + FhirR4CodeableConcept code = null; + FhirR4Quantity valueQuantity = null; + FhirR4CodeableConcept valueCodeableConcept = null; + String valueString = null; + Boolean valueBoolean = null; + Integer valueInteger = null; + FhirR4Range valueRange = null; + FhirR4Ratio valueRatio = null; + FhirR4SampledData valueSampledData = null; + String valueTime = null; + String valueDateTime = null; + FhirR4Period valuePeriod = null; + FhirR4Reference valueReference = null; + FhirR4CodeableConcept dataAbsentReason = null; + List interpretation = null; + List referenceRange = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("code".equals(fieldName)) { + code = FhirR4CodeableConcept.fromJson(reader); + } else if ("valueQuantity".equals(fieldName)) { + valueQuantity = FhirR4Quantity.fromJson(reader); + } else if ("valueCodeableConcept".equals(fieldName)) { + valueCodeableConcept = FhirR4CodeableConcept.fromJson(reader); + } else if ("valueString".equals(fieldName)) { + valueString = reader.getString(); + } else if ("valueBoolean".equals(fieldName)) { + valueBoolean = reader.getNullable(JsonReader::getBoolean); + } else if ("valueInteger".equals(fieldName)) { + valueInteger = reader.getNullable(JsonReader::getInt); + } else if ("valueRange".equals(fieldName)) { + valueRange = FhirR4Range.fromJson(reader); + } else if ("valueRatio".equals(fieldName)) { + valueRatio = FhirR4Ratio.fromJson(reader); + } else if ("valueSampledData".equals(fieldName)) { + valueSampledData = FhirR4SampledData.fromJson(reader); + } else if ("valueTime".equals(fieldName)) { + valueTime = reader.getString(); + } else if ("valueDateTime".equals(fieldName)) { + valueDateTime = reader.getString(); + } else if ("valuePeriod".equals(fieldName)) { + valuePeriod = FhirR4Period.fromJson(reader); + } else if ("valueReference".equals(fieldName)) { + valueReference = FhirR4Reference.fromJson(reader); + } else if ("dataAbsentReason".equals(fieldName)) { + dataAbsentReason = FhirR4CodeableConcept.fromJson(reader); + } else if ("interpretation".equals(fieldName)) { + interpretation = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("referenceRange".equals(fieldName)) { + referenceRange = reader.readArray(reader1 -> FhirR4ObservationReferenceRange.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + FhirR4ObservationComponent deserializedFhirR4ObservationComponent = new FhirR4ObservationComponent(code); + deserializedFhirR4ObservationComponent.setId(id); + deserializedFhirR4ObservationComponent.setExtension(extension); + deserializedFhirR4ObservationComponent.valueQuantity = valueQuantity; + deserializedFhirR4ObservationComponent.valueCodeableConcept = valueCodeableConcept; + deserializedFhirR4ObservationComponent.valueString = valueString; + deserializedFhirR4ObservationComponent.valueBoolean = valueBoolean; + deserializedFhirR4ObservationComponent.valueInteger = valueInteger; + deserializedFhirR4ObservationComponent.valueRange = valueRange; + deserializedFhirR4ObservationComponent.valueRatio = valueRatio; + deserializedFhirR4ObservationComponent.valueSampledData = valueSampledData; + deserializedFhirR4ObservationComponent.valueTime = valueTime; + deserializedFhirR4ObservationComponent.valueDateTime = valueDateTime; + deserializedFhirR4ObservationComponent.valuePeriod = valuePeriod; + deserializedFhirR4ObservationComponent.valueReference = valueReference; + deserializedFhirR4ObservationComponent.dataAbsentReason = dataAbsentReason; + deserializedFhirR4ObservationComponent.interpretation = interpretation; + deserializedFhirR4ObservationComponent.referenceRange = referenceRange; + return deserializedFhirR4ObservationComponent; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationReferenceRange.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationReferenceRange.java index eb64728ee72bc..6c7fc75eb9c31 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationReferenceRange.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ObservationReferenceRange.java @@ -5,7 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,48 +17,42 @@ * Based on [FHIR Observation.referenceRange](https://www.hl7.org/fhir/R4/observation.html). */ @Immutable -public final class FhirR4ObservationReferenceRange { +public final class FhirR4ObservationReferenceRange implements JsonSerializable { /* * Low Range, if relevant */ @Generated - @JsonProperty(value = "low") private FhirR4Quantity low; /* * High Range, if relevant */ @Generated - @JsonProperty(value = "high") private FhirR4Quantity high; /* * Reference range qualifier */ @Generated - @JsonProperty(value = "type") private FhirR4CodeableConcept type; /* * Reference range population */ @Generated - @JsonProperty(value = "appliesTo") private List appliesTo; /* * Applicable age range, if relevant */ @Generated - @JsonProperty(value = "age") private FhirR4Range age; /* * Text based reference range in an observation */ @Generated - @JsonProperty(value = "text") private String text; /** @@ -123,4 +121,58 @@ public FhirR4Range getAge() { public String getText() { return this.text; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("low", this.low); + jsonWriter.writeJsonField("high", this.high); + jsonWriter.writeJsonField("type", this.type); + jsonWriter.writeArrayField("appliesTo", this.appliesTo, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("age", this.age); + jsonWriter.writeStringField("text", this.text); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4ObservationReferenceRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4ObservationReferenceRange if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4ObservationReferenceRange. + */ + @Generated + public static FhirR4ObservationReferenceRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4ObservationReferenceRange deserializedFhirR4ObservationReferenceRange + = new FhirR4ObservationReferenceRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("low".equals(fieldName)) { + deserializedFhirR4ObservationReferenceRange.low = FhirR4Quantity.fromJson(reader); + } else if ("high".equals(fieldName)) { + deserializedFhirR4ObservationReferenceRange.high = FhirR4Quantity.fromJson(reader); + } else if ("type".equals(fieldName)) { + deserializedFhirR4ObservationReferenceRange.type = FhirR4CodeableConcept.fromJson(reader); + } else if ("appliesTo".equals(fieldName)) { + List appliesTo + = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + deserializedFhirR4ObservationReferenceRange.appliesTo = appliesTo; + } else if ("age".equals(fieldName)) { + deserializedFhirR4ObservationReferenceRange.age = FhirR4Range.fromJson(reader); + } else if ("text".equals(fieldName)) { + deserializedFhirR4ObservationReferenceRange.text = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4ObservationReferenceRange; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Period.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Period.java index 7af99c0805500..a1b08b91af80c 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Period.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Period.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,14 +22,12 @@ public final class FhirR4Period extends FhirR4Element { * Starting time with inclusive boundary */ @Generated - @JsonProperty(value = "start") private String start; /* * End time with inclusive boundary, if not ongoing */ @Generated - @JsonProperty(value = "end") private String end; /** @@ -99,4 +100,50 @@ public FhirR4Period setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("start", this.start); + jsonWriter.writeStringField("end", this.end); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Period from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Period if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Period. + */ + @Generated + public static FhirR4Period fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Period deserializedFhirR4Period = new FhirR4Period(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Period.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Period.setExtension(extension); + } else if ("start".equals(fieldName)) { + deserializedFhirR4Period.start = reader.getString(); + } else if ("end".equals(fieldName)) { + deserializedFhirR4Period.end = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Period; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Quantity.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Quantity.java index d85dcf226aa78..27d71def0ffad 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Quantity.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Quantity.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,35 +22,30 @@ public final class FhirR4Quantity extends FhirR4Element { * Numerical value (with implicit precision) */ @Generated - @JsonProperty(value = "value") private Double value; /* * < | <= | >= | > - how to understand the value */ @Generated - @JsonProperty(value = "comparator") private String comparator; /* * Unit representation */ @Generated - @JsonProperty(value = "unit") private String unit; /* * System that defines coded unit form */ @Generated - @JsonProperty(value = "system") private String system; /* * Coded form of the unit */ @Generated - @JsonProperty(value = "code") private String code; /** @@ -186,4 +184,59 @@ public FhirR4Quantity setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeStringField("comparator", this.comparator); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeStringField("system", this.system); + jsonWriter.writeStringField("code", this.code); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Quantity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Quantity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Quantity. + */ + @Generated + public static FhirR4Quantity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Quantity deserializedFhirR4Quantity = new FhirR4Quantity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Quantity.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Quantity.setExtension(extension); + } else if ("value".equals(fieldName)) { + deserializedFhirR4Quantity.value = reader.getNullable(JsonReader::getDouble); + } else if ("comparator".equals(fieldName)) { + deserializedFhirR4Quantity.comparator = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedFhirR4Quantity.unit = reader.getString(); + } else if ("system".equals(fieldName)) { + deserializedFhirR4Quantity.system = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedFhirR4Quantity.code = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Quantity; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Range.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Range.java index 3da346e6cd6c8..134f1afa803c2 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Range.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Range.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,14 +22,12 @@ public final class FhirR4Range extends FhirR4Element { * Low limit */ @Generated - @JsonProperty(value = "low") private FhirR4Quantity low; /* * High limit */ @Generated - @JsonProperty(value = "high") private FhirR4Quantity high; /** @@ -99,4 +100,50 @@ public FhirR4Range setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("low", this.low); + jsonWriter.writeJsonField("high", this.high); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Range from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Range if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Range. + */ + @Generated + public static FhirR4Range fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Range deserializedFhirR4Range = new FhirR4Range(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Range.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Range.setExtension(extension); + } else if ("low".equals(fieldName)) { + deserializedFhirR4Range.low = FhirR4Quantity.fromJson(reader); + } else if ("high".equals(fieldName)) { + deserializedFhirR4Range.high = FhirR4Quantity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Range; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Ratio.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Ratio.java index c1587cb0fca5d..f58a753c6bfa8 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Ratio.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Ratio.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,14 +22,12 @@ public final class FhirR4Ratio extends FhirR4Element { * Numerator value */ @Generated - @JsonProperty(value = "numerator") private FhirR4Quantity numerator; /* * Denominator value */ @Generated - @JsonProperty(value = "denominator") private FhirR4Quantity denominator; /** @@ -99,4 +100,50 @@ public FhirR4Ratio setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("numerator", this.numerator); + jsonWriter.writeJsonField("denominator", this.denominator); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Ratio from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Ratio if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Ratio. + */ + @Generated + public static FhirR4Ratio fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Ratio deserializedFhirR4Ratio = new FhirR4Ratio(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Ratio.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Ratio.setExtension(extension); + } else if ("numerator".equals(fieldName)) { + deserializedFhirR4Ratio.numerator = FhirR4Quantity.fromJson(reader); + } else if ("denominator".equals(fieldName)) { + deserializedFhirR4Ratio.denominator = FhirR4Quantity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Ratio; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Reference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Reference.java index 33f3cd46a7bb3..b91eb2ae069ad 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Reference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Reference.java @@ -5,7 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -19,28 +22,24 @@ public final class FhirR4Reference extends FhirR4Element { * Literal reference, Relative, internal or absolute URL */ @Generated - @JsonProperty(value = "reference") private String reference; /* * Type the reference refers to (e.g. "Patient") */ @Generated - @JsonProperty(value = "type") private String type; /* * Logical reference, when literal reference is not known */ @Generated - @JsonProperty(value = "identifier") private FhirR4Identifier identifier; /* * Text alternative for the resource */ @Generated - @JsonProperty(value = "display") private String display; /** @@ -157,4 +156,56 @@ public FhirR4Reference setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("reference", this.reference); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("identifier", this.identifier); + jsonWriter.writeStringField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Reference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Reference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FhirR4Reference. + */ + @Generated + public static FhirR4Reference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4Reference deserializedFhirR4Reference = new FhirR4Reference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFhirR4Reference.setId(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedFhirR4Reference.setExtension(extension); + } else if ("reference".equals(fieldName)) { + deserializedFhirR4Reference.reference = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFhirR4Reference.type = reader.getString(); + } else if ("identifier".equals(fieldName)) { + deserializedFhirR4Reference.identifier = FhirR4Identifier.fromJson(reader); + } else if ("display".equals(fieldName)) { + deserializedFhirR4Reference.display = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFhirR4Reference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ResearchStudy.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ResearchStudy.java index aded3b2e98189..9464884ead1d7 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ResearchStudy.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4ResearchStudy.java @@ -5,23 +5,18 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * Detailed information about Research Study * Based on [FHIR ResearchStudy](https://www.hl7.org/fhir/R4/researchstudy.html). */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "resourceType", - defaultImpl = FhirR4ResearchStudy.class, - visible = true) -@JsonTypeName("ResearchStudy") @Immutable public final class FhirR4ResearchStudy extends FhirR4DomainResource { @@ -29,36 +24,30 @@ public final class FhirR4ResearchStudy extends FhirR4DomainResource { * Discriminator property for Fhir_R4_DomainResource. */ @Generated - @JsonTypeId - @JsonProperty(value = "resourceType") private String resourceType = "ResearchStudy"; /* * Business Identifier for study */ @Generated - @JsonProperty(value = "identifier") private List identifier; /* * Name for this study */ @Generated - @JsonProperty(value = "title") private String title; /* * Steps followed in executing study */ @Generated - @JsonProperty(value = "protocol") private List protocol; /* * Part of larger study */ @Generated - @JsonProperty(value = "partOf") private List partOf; /* @@ -67,7 +56,6 @@ public final class FhirR4ResearchStudy extends FhirR4DomainResource { * temporarily-closed-to-accrual-and-intervention | withdrawn */ @Generated - @JsonProperty(value = "status") private final ResearchStudyStatusCodeType status; /* @@ -75,98 +63,84 @@ public final class FhirR4ResearchStudy extends FhirR4DomainResource { * device-feasibility */ @Generated - @JsonProperty(value = "primaryPurposeType") private FhirR4CodeableConcept primaryPurposeType; /* * n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4 */ @Generated - @JsonProperty(value = "phase") private FhirR4CodeableConcept phase; /* * Classifications for the study */ @Generated - @JsonProperty(value = "category") private List category; /* * Drugs, devices, etc. under study */ @Generated - @JsonProperty(value = "focus") private List focus; /* * Condition being studied */ @Generated - @JsonProperty(value = "condition") private List condition; /* * Contact details for the study */ @Generated - @JsonProperty(value = "contact") private List contact; /* * Used to search for the study */ @Generated - @JsonProperty(value = "keyword") private List keyword; /* * Geographic region(s) for study */ @Generated - @JsonProperty(value = "location") private List location; /* * What this is study doing */ @Generated - @JsonProperty(value = "description") private String description; /* * Inclusion & exclusion criteria */ @Generated - @JsonProperty(value = "enrollment") private List enrollment; /* * When the study began and ended */ @Generated - @JsonProperty(value = "period") private FhirR4Period period; /* * Organization that initiates and is legally responsible for the study */ @Generated - @JsonProperty(value = "sponsor") private FhirR4Reference sponsor; /* * Researcher who oversees multiple aspects of the study */ @Generated - @JsonProperty(value = "principalInvestigator") private FhirR4Reference principalInvestigator; /* * Facility where study activities are conducted */ @Generated - @JsonProperty(value = "site") private List site; /* @@ -174,28 +148,24 @@ public final class FhirR4ResearchStudy extends FhirR4DomainResource { * temporarily-closed-per-study-design */ @Generated - @JsonProperty(value = "reasonStopped") private FhirR4CodeableConcept reasonStopped; /* * Comments made about the study */ @Generated - @JsonProperty(value = "note") private List note; /* * Defined path through the study for a subject */ @Generated - @JsonProperty(value = "arm") private List arm; /* * A goal for the study */ @Generated - @JsonProperty(value = "objective") private List objective; /** @@ -205,9 +175,7 @@ public final class FhirR4ResearchStudy extends FhirR4DomainResource { * @param status the status value to set. */ @Generated - @JsonCreator - private FhirR4ResearchStudy(@JsonProperty(value = "resourceType") String resourceType, - @JsonProperty(value = "status") ResearchStudyStatusCodeType status) { + private FhirR4ResearchStudy(String resourceType, ResearchStudyStatusCodeType status) { super(resourceType); this.status = status; } @@ -457,4 +425,276 @@ public List getArm() { public List getObjective() { return this.objective; } + + /* + * Extensions that cannot be ignored + */ + @Generated + private List modifierExtension; + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /* + * Contained, inline Resources + */ + @Generated + private List contained; + + /* + * Text summary of the resource, for human interpretation + */ + @Generated + private FhirR4Narrative text; + + /** + * Get the modifierExtension property: Extensions that cannot be ignored. + * + * @return the modifierExtension value. + */ + @Generated + @Override + public List getModifierExtension() { + return this.modifierExtension; + } + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * Get the contained property: Contained, inline Resources. + * + * @return the contained value. + */ + @Generated + @Override + public List getContained() { + return this.contained; + } + + /** + * Get the text property: Text summary of the resource, for human interpretation. + * + * @return the text value. + */ + @Generated + @Override + public FhirR4Narrative getText() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeJsonField("meta", getMeta()); + jsonWriter.writeStringField("implicitRules", getImplicitRules()); + jsonWriter.writeStringField("language", getLanguage()); + jsonWriter.writeJsonField("text", getText()); + jsonWriter.writeArrayField("contained", getContained(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("modifierExtension", getModifierExtension(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeArrayField("identifier", this.identifier, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeArrayField("protocol", this.protocol, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("partOf", this.partOf, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("primaryPurposeType", this.primaryPurposeType); + jsonWriter.writeJsonField("phase", this.phase); + jsonWriter.writeArrayField("category", this.category, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("focus", this.focus, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("condition", this.condition, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("contact", this.contact, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("keyword", this.keyword, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("location", this.location, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("enrollment", this.enrollment, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("period", this.period); + jsonWriter.writeJsonField("sponsor", this.sponsor); + jsonWriter.writeJsonField("principalInvestigator", this.principalInvestigator); + jsonWriter.writeArrayField("site", this.site, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("reasonStopped", this.reasonStopped); + jsonWriter.writeArrayField("note", this.note, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("arm", this.arm, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("objective", this.objective, (writer, element) -> writer.writeJson(element)); + if (getAdditionalProperties() != null) { + for (Map.Entry additionalProperty : getAdditionalProperties().entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4ResearchStudy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4ResearchStudy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4ResearchStudy. + */ + @Generated + public static FhirR4ResearchStudy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + FhirR4Meta meta = null; + String implicitRules = null; + String language = null; + FhirR4Narrative text = null; + List contained = null; + List extension = null; + List modifierExtension = null; + ResearchStudyStatusCodeType status = null; + String resourceType = "ResearchStudy"; + List identifier = null; + String title = null; + List protocol = null; + List partOf = null; + FhirR4CodeableConcept primaryPurposeType = null; + FhirR4CodeableConcept phase = null; + List category = null; + List focus = null; + List condition = null; + List contact = null; + List keyword = null; + List location = null; + String description = null; + List enrollment = null; + FhirR4Period period = null; + FhirR4Reference sponsor = null; + FhirR4Reference principalInvestigator = null; + List site = null; + FhirR4CodeableConcept reasonStopped = null; + List note = null; + List arm = null; + List objective = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("meta".equals(fieldName)) { + meta = FhirR4Meta.fromJson(reader); + } else if ("implicitRules".equals(fieldName)) { + implicitRules = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("text".equals(fieldName)) { + text = FhirR4Narrative.fromJson(reader); + } else if ("contained".equals(fieldName)) { + contained = reader.readArray(reader1 -> FhirR4Resource.fromJson(reader1)); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("modifierExtension".equals(fieldName)) { + modifierExtension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("status".equals(fieldName)) { + status = ResearchStudyStatusCodeType.fromString(reader.getString()); + } else if ("resourceType".equals(fieldName)) { + resourceType = reader.getString(); + } else if ("identifier".equals(fieldName)) { + identifier = reader.readArray(reader1 -> FhirR4Identifier.fromJson(reader1)); + } else if ("title".equals(fieldName)) { + title = reader.getString(); + } else if ("protocol".equals(fieldName)) { + protocol = reader.readArray(reader1 -> FhirR4Reference.fromJson(reader1)); + } else if ("partOf".equals(fieldName)) { + partOf = reader.readArray(reader1 -> FhirR4Reference.fromJson(reader1)); + } else if ("primaryPurposeType".equals(fieldName)) { + primaryPurposeType = FhirR4CodeableConcept.fromJson(reader); + } else if ("phase".equals(fieldName)) { + phase = FhirR4CodeableConcept.fromJson(reader); + } else if ("category".equals(fieldName)) { + category = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("focus".equals(fieldName)) { + focus = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("condition".equals(fieldName)) { + condition = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("contact".equals(fieldName)) { + contact = reader.readArray(reader1 -> FhirR4ContactDetail.fromJson(reader1)); + } else if ("keyword".equals(fieldName)) { + keyword = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("location".equals(fieldName)) { + location = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("enrollment".equals(fieldName)) { + enrollment = reader.readArray(reader1 -> FhirR4Reference.fromJson(reader1)); + } else if ("period".equals(fieldName)) { + period = FhirR4Period.fromJson(reader); + } else if ("sponsor".equals(fieldName)) { + sponsor = FhirR4Reference.fromJson(reader); + } else if ("principalInvestigator".equals(fieldName)) { + principalInvestigator = FhirR4Reference.fromJson(reader); + } else if ("site".equals(fieldName)) { + site = reader.readArray(reader1 -> FhirR4Reference.fromJson(reader1)); + } else if ("reasonStopped".equals(fieldName)) { + reasonStopped = FhirR4CodeableConcept.fromJson(reader); + } else if ("note".equals(fieldName)) { + note = reader.readArray(reader1 -> FhirR4Annotation.fromJson(reader1)); + } else if ("arm".equals(fieldName)) { + arm = reader.readArray(reader1 -> ResearchStudyArm.fromJson(reader1)); + } else if ("objective".equals(fieldName)) { + objective = reader.readArray(reader1 -> ResearchStudyObjective.fromJson(reader1)); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + FhirR4ResearchStudy deserializedFhirR4ResearchStudy = new FhirR4ResearchStudy(resourceType, status); + deserializedFhirR4ResearchStudy.setId(id); + deserializedFhirR4ResearchStudy.setMeta(meta); + deserializedFhirR4ResearchStudy.setImplicitRules(implicitRules); + deserializedFhirR4ResearchStudy.setLanguage(language); + deserializedFhirR4ResearchStudy.text = text; + deserializedFhirR4ResearchStudy.contained = contained; + deserializedFhirR4ResearchStudy.extension = extension; + deserializedFhirR4ResearchStudy.modifierExtension = modifierExtension; + deserializedFhirR4ResearchStudy.resourceType = resourceType; + deserializedFhirR4ResearchStudy.identifier = identifier; + deserializedFhirR4ResearchStudy.title = title; + deserializedFhirR4ResearchStudy.protocol = protocol; + deserializedFhirR4ResearchStudy.partOf = partOf; + deserializedFhirR4ResearchStudy.primaryPurposeType = primaryPurposeType; + deserializedFhirR4ResearchStudy.phase = phase; + deserializedFhirR4ResearchStudy.category = category; + deserializedFhirR4ResearchStudy.focus = focus; + deserializedFhirR4ResearchStudy.condition = condition; + deserializedFhirR4ResearchStudy.contact = contact; + deserializedFhirR4ResearchStudy.keyword = keyword; + deserializedFhirR4ResearchStudy.location = location; + deserializedFhirR4ResearchStudy.description = description; + deserializedFhirR4ResearchStudy.enrollment = enrollment; + deserializedFhirR4ResearchStudy.period = period; + deserializedFhirR4ResearchStudy.sponsor = sponsor; + deserializedFhirR4ResearchStudy.principalInvestigator = principalInvestigator; + deserializedFhirR4ResearchStudy.site = site; + deserializedFhirR4ResearchStudy.reasonStopped = reasonStopped; + deserializedFhirR4ResearchStudy.note = note; + deserializedFhirR4ResearchStudy.arm = arm; + deserializedFhirR4ResearchStudy.objective = objective; + deserializedFhirR4ResearchStudy.setAdditionalProperties(additionalProperties); + return deserializedFhirR4ResearchStudy; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Resource.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Resource.java index 623c8a7edf586..3e32644761ac1 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Resource.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4Resource.java @@ -5,11 +5,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map; @@ -19,48 +19,42 @@ * Based on [FHIR Resource](https://www.hl7.org/fhir/r4/resource.html. */ @Fluent -public class FhirR4Resource { +public class FhirR4Resource implements JsonSerializable { /* * The type of resource */ @Generated - @JsonProperty(value = "resourceType") private final String resourceType; /* * Resource Id */ @Generated - @JsonProperty(value = "id") private String id; /* * Metadata about the resource */ @Generated - @JsonProperty(value = "meta") private FhirR4Meta meta; /* * A set of rules under which this content was created */ @Generated - @JsonProperty(value = "implicitRules") private String implicitRules; /* * Language of the resource content */ @Generated - @JsonProperty(value = "language") private String language; /* * Additional properties */ @Generated - @JsonIgnore private Map additionalProperties; /** @@ -69,8 +63,7 @@ public class FhirR4Resource { * @param resourceType the resourceType value to set. */ @Generated - @JsonCreator - public FhirR4Resource(@JsonProperty(value = "resourceType") String resourceType) { + public FhirR4Resource(String resourceType) { this.resourceType = resourceType; } @@ -178,7 +171,6 @@ public FhirR4Resource setLanguage(String language) { * @return the additionalProperties value. */ @Generated - @JsonAnyGetter public Map getAdditionalProperties() { return this.additionalProperties; } @@ -195,12 +187,71 @@ public FhirR4Resource setAdditionalProperties(Map additionalProp return this; } + /** + * {@inheritDoc} + */ @Generated - @JsonAnySetter - void setAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("meta", this.meta); + jsonWriter.writeStringField("implicitRules", this.implicitRules); + jsonWriter.writeStringField("language", this.language); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } } - additionalProperties.put(key, value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4Resource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4Resource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4Resource. + */ + @Generated + public static FhirR4Resource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String resourceType = null; + String id = null; + FhirR4Meta meta = null; + String implicitRules = null; + String language = null; + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("resourceType".equals(fieldName)) { + resourceType = reader.getString(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("meta".equals(fieldName)) { + meta = FhirR4Meta.fromJson(reader); + } else if ("implicitRules".equals(fieldName)) { + implicitRules = reader.getString(); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + FhirR4Resource deserializedFhirR4Resource = new FhirR4Resource(resourceType); + deserializedFhirR4Resource.id = id; + deserializedFhirR4Resource.meta = meta; + deserializedFhirR4Resource.implicitRules = implicitRules; + deserializedFhirR4Resource.language = language; + deserializedFhirR4Resource.additionalProperties = additionalProperties; + return deserializedFhirR4Resource; + }); } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4SampledData.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4SampledData.java index e471e06ead473..dcbbb0e22a8b7 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4SampledData.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FhirR4SampledData.java @@ -5,8 +5,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -20,49 +22,42 @@ public final class FhirR4SampledData extends FhirR4Element { * Zero value and units */ @Generated - @JsonProperty(value = "origin") private final FhirR4Quantity origin; /* * Number of milliseconds between samples */ @Generated - @JsonProperty(value = "period") private final double period; /* * Multiply data by this before adding to origin */ @Generated - @JsonProperty(value = "factor") private Double factor; /* * Lower limit of detection */ @Generated - @JsonProperty(value = "lowerLimit") private Double lowerLimit; /* * Upper limit of detection */ @Generated - @JsonProperty(value = "upperLimit") private Double upperLimit; /* * Number of sample points at each time point */ @Generated - @JsonProperty(value = "dimensions") private final int dimensions; /* * Decimal values with spaces, or "E" | "U" | "L" */ @Generated - @JsonProperty(value = "data") private String data; /** @@ -73,9 +68,7 @@ public final class FhirR4SampledData extends FhirR4Element { * @param dimensions the dimensions value to set. */ @Generated - @JsonCreator - public FhirR4SampledData(@JsonProperty(value = "origin") FhirR4Quantity origin, - @JsonProperty(value = "period") double period, @JsonProperty(value = "dimensions") int dimensions) { + public FhirR4SampledData(FhirR4Quantity origin, double period, int dimensions) { this.origin = origin; this.period = period; this.dimensions = dimensions; @@ -218,4 +211,80 @@ public FhirR4SampledData setExtension(List extension) { super.setExtension(extension); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("origin", this.origin); + jsonWriter.writeDoubleField("period", this.period); + jsonWriter.writeIntField("dimensions", this.dimensions); + jsonWriter.writeNumberField("factor", this.factor); + jsonWriter.writeNumberField("lowerLimit", this.lowerLimit); + jsonWriter.writeNumberField("upperLimit", this.upperLimit); + jsonWriter.writeStringField("data", this.data); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FhirR4SampledData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FhirR4SampledData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FhirR4SampledData. + */ + @Generated + public static FhirR4SampledData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + List extension = null; + FhirR4Quantity origin = null; + double period = 0.0; + int dimensions = 0; + Double factor = null; + Double lowerLimit = null; + Double upperLimit = null; + String data = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("origin".equals(fieldName)) { + origin = FhirR4Quantity.fromJson(reader); + } else if ("period".equals(fieldName)) { + period = reader.getDouble(); + } else if ("dimensions".equals(fieldName)) { + dimensions = reader.getInt(); + } else if ("factor".equals(fieldName)) { + factor = reader.getNullable(JsonReader::getDouble); + } else if ("lowerLimit".equals(fieldName)) { + lowerLimit = reader.getNullable(JsonReader::getDouble); + } else if ("upperLimit".equals(fieldName)) { + upperLimit = reader.getNullable(JsonReader::getDouble); + } else if ("data".equals(fieldName)) { + data = reader.getString(); + } else { + reader.skipChildren(); + } + } + FhirR4SampledData deserializedFhirR4SampledData = new FhirR4SampledData(origin, period, dimensions); + deserializedFhirR4SampledData.setId(id); + deserializedFhirR4SampledData.setExtension(extension); + deserializedFhirR4SampledData.factor = factor; + deserializedFhirR4SampledData.lowerLimit = lowerLimit; + deserializedFhirR4SampledData.upperLimit = upperLimit; + deserializedFhirR4SampledData.data = data; + return deserializedFhirR4SampledData; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingInference.java index 72ff804c09a18..e170b4c0c728f 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingInference.java @@ -5,18 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * Findings in a radiology report typically describe abnormalities, lesions, or other notable observations related to * the anatomy or pathology of the imaged area. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = FindingInference.class, visible = true) -@JsonTypeName("finding") @Immutable public final class FindingInference extends RadiologyInsightsInference { @@ -24,15 +22,12 @@ public final class FindingInference extends RadiologyInsightsInference { * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.FINDING; /* * Finding data : contains extensions, fields and components linked with the finding. */ @Generated - @JsonProperty(value = "finding") private final FhirR4Observation finding; /** @@ -41,8 +36,7 @@ public final class FindingInference extends RadiologyInsightsInference { * @param finding the finding value to set. */ @Generated - @JsonCreator - private FindingInference(@JsonProperty(value = "finding") FhirR4Observation finding) { + private FindingInference(FhirR4Observation finding) { this.finding = finding; } @@ -66,4 +60,69 @@ public RadiologyInsightsInferenceType getKind() { public FhirR4Observation getFinding() { return this.finding; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("finding", this.finding); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FindingInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FindingInference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FindingInference. + */ + @Generated + public static FindingInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + FhirR4Observation finding = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.FINDING; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("finding".equals(fieldName)) { + finding = FhirR4Observation.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FindingInference deserializedFindingInference = new FindingInference(finding); + deserializedFindingInference.extension = extension; + deserializedFindingInference.kind = kind; + return deserializedFindingInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingOptions.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingOptions.java index 12b3149bb1897..cf87889a9ae0f 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingOptions.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FindingOptions.java @@ -5,13 +5,17 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Finding options. */ @Fluent -public final class FindingOptions { +public final class FindingOptions implements JsonSerializable { /* * If this is true, provide the sentence that contains the first token of the finding's clinical indicator (i.e. the @@ -19,7 +23,6 @@ public final class FindingOptions { * token evidence. Default is false. */ @Generated - @JsonProperty(value = "provideFocusedSentenceEvidence") private Boolean provideFocusedSentenceEvidence; /** @@ -54,4 +57,41 @@ public FindingOptions setProvideFocusedSentenceEvidence(Boolean provideFocusedSe this.provideFocusedSentenceEvidence = provideFocusedSentenceEvidence; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("provideFocusedSentenceEvidence", this.provideFocusedSentenceEvidence); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FindingOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FindingOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FindingOptions. + */ + @Generated + public static FindingOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FindingOptions deserializedFindingOptions = new FindingOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("provideFocusedSentenceEvidence".equals(fieldName)) { + deserializedFindingOptions.provideFocusedSentenceEvidence + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedFindingOptions; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupCommunicationInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupCommunicationInference.java index cf07875117e36..74d686d64b8bc 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupCommunicationInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupCommunicationInference.java @@ -5,24 +5,19 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * Follow-up communication involves the exchange of important information, recommendations, or updates between * radiologists and other healthcare professionals involved in a patient's care. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = FollowupCommunicationInference.class, - visible = true) -@JsonTypeName("followupCommunication") @Immutable public final class FollowupCommunicationInference extends RadiologyInsightsInference { @@ -30,40 +25,22 @@ public final class FollowupCommunicationInference extends RadiologyInsightsInfer * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION; - /* - * Communication date and time. - */ - @Generated - @JsonProperty(value = "dateTime") - private List dateTime; - /* * Recipient of the communication. */ @Generated - @JsonProperty(value = "recipient") private List recipient; - /* - * Communication was acknowledged. - */ - @Generated - @JsonProperty(value = "wasAcknowledged") - private final boolean wasAcknowledged; - /** * Creates an instance of FollowupCommunicationInference class. * - * @param wasAcknowledged the wasAcknowledged value to set. + * @param acknowledged the acknowledged value to set. */ @Generated - @JsonCreator - private FollowupCommunicationInference(@JsonProperty(value = "wasAcknowledged") boolean wasAcknowledged) { - this.wasAcknowledged = wasAcknowledged; + private FollowupCommunicationInference(boolean acknowledged) { + this.acknowledged = acknowledged; } /** @@ -78,32 +55,123 @@ public RadiologyInsightsInferenceType getKind() { } /** - * Get the dateTime property: Communication date and time. + * Get the recipient property: Recipient of the communication. * - * @return the dateTime value. + * @return the recipient value. */ @Generated - public List getDateTime() { - return this.dateTime; + public List getRecipient() { + return this.recipient; } + /* + * Communication date and time. + */ + @Generated + private List communicatedAt; + + /* + * Communication was acknowledged. + */ + @Generated + private final boolean acknowledged; + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + /** - * Get the recipient property: Recipient of the communication. + * Get the communicatedAt property: Communication date and time. * - * @return the recipient value. + * @return the communicatedAt value. */ @Generated - public List getRecipient() { - return this.recipient; + public List getCommunicatedAt() { + return this.communicatedAt; + } + + /** + * Get the acknowledged property: Communication was acknowledged. + * + * @return the acknowledged value. + */ + @Generated + public boolean isAcknowledged() { + return this.acknowledged; + } + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("wasAcknowledged", this.acknowledged); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("communicatedAt", this.communicatedAt, (writer, element) -> writer + .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); + jsonWriter.writeArrayField("recipient", this.recipient, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); } /** - * Get the wasAcknowledged property: Communication was acknowledged. + * Reads an instance of FollowupCommunicationInference from the JsonReader. * - * @return the wasAcknowledged value. + * @param jsonReader The JsonReader being read. + * @return An instance of FollowupCommunicationInference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FollowupCommunicationInference. */ @Generated - public boolean isWasAcknowledged() { - return this.wasAcknowledged; + public static FollowupCommunicationInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + boolean acknowledged = false; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.FOLLOWUP_COMMUNICATION; + List communicatedAt = null; + List recipient = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("wasAcknowledged".equals(fieldName)) { + acknowledged = reader.getBoolean(); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("communicatedAt".equals(fieldName)) { + communicatedAt = reader.readArray(reader1 -> reader1 + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("recipient".equals(fieldName)) { + recipient = reader.readArray(reader1 -> MedicalProfessionalType.fromString(reader1.getString())); + } else { + reader.skipChildren(); + } + } + FollowupCommunicationInference deserializedFollowupCommunicationInference + = new FollowupCommunicationInference(acknowledged); + deserializedFollowupCommunicationInference.extension = extension; + deserializedFollowupCommunicationInference.kind = kind; + deserializedFollowupCommunicationInference.communicatedAt = communicatedAt; + deserializedFollowupCommunicationInference.recipient = recipient; + return deserializedFollowupCommunicationInference; + }); } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationInference.java index ef08a068f81df..60bb05bec1eaf 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationInference.java @@ -5,23 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Follow-up recommendations offer guidance to healthcare providers on managing and monitoring patients based on the * findings of imaging studies. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = FollowupRecommendationInference.class, - visible = true) -@JsonTypeName("followupRecommendation") @Immutable public final class FollowupRecommendationInference extends RadiologyInsightsInference { @@ -29,29 +22,18 @@ public final class FollowupRecommendationInference extends RadiologyInsightsInfe * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION; - /* - * Date and time are displayed when the procedure is recommended to be done at a specific point in time. - */ - @Generated - @JsonProperty(value = "effectiveDateTime") - private String effectiveDateTime; - /* * The period is shown if a specific period is mentioned, with a start and end date-time. */ @Generated - @JsonProperty(value = "effectivePeriod") private FhirR4Period effectivePeriod; /* * Findings related to the recommendation. */ @Generated - @JsonProperty(value = "findings") private List findings; /* @@ -59,7 +41,6 @@ public final class FollowupRecommendationInference extends RadiologyInsightsInfe * statement. Keywords for conditional statements include 'if', 'when', 'unless', and so on. */ @Generated - @JsonProperty(value = "isConditional") private final boolean isConditional; /* @@ -67,7 +48,6 @@ public final class FollowupRecommendationInference extends RadiologyInsightsInfe * statement. Keywords for optional statements include 'recommend', 'consider', and so on. */ @Generated - @JsonProperty(value = "isOption") private final boolean isOption; /* @@ -75,7 +55,6 @@ public final class FollowupRecommendationInference extends RadiologyInsightsInfe * recommendations applicable to various findings. */ @Generated - @JsonProperty(value = "isGuideline") private final boolean isGuideline; /* @@ -83,14 +62,12 @@ public final class FollowupRecommendationInference extends RadiologyInsightsInfe * hedging are 'can be','may be',and so on. */ @Generated - @JsonProperty(value = "isHedging") private final boolean isHedging; /* * The procedure recommendation can be a generic procedure or an imaging procedure. */ @Generated - @JsonProperty(value = "recommendedProcedure") private final ProcedureRecommendation recommendedProcedure; /** @@ -103,11 +80,8 @@ public final class FollowupRecommendationInference extends RadiologyInsightsInfe * @param recommendedProcedure the recommendedProcedure value to set. */ @Generated - @JsonCreator - private FollowupRecommendationInference(@JsonProperty(value = "isConditional") boolean isConditional, - @JsonProperty(value = "isOption") boolean isOption, @JsonProperty(value = "isGuideline") boolean isGuideline, - @JsonProperty(value = "isHedging") boolean isHedging, - @JsonProperty(value = "recommendedProcedure") ProcedureRecommendation recommendedProcedure) { + private FollowupRecommendationInference(boolean isConditional, boolean isOption, boolean isGuideline, + boolean isHedging, ProcedureRecommendation recommendedProcedure) { this.isConditional = isConditional; this.isOption = isOption; this.isGuideline = isGuideline; @@ -126,17 +100,6 @@ public RadiologyInsightsInferenceType getKind() { return this.kind; } - /** - * Get the effectiveDateTime property: Date and time are displayed when the procedure is recommended to be done at a - * specific point in time. - * - * @return the effectiveDateTime value. - */ - @Generated - public String getEffectiveDateTime() { - return this.effectiveDateTime; - } - /** * Get the effectivePeriod property: The period is shown if a specific period is mentioned, with a start and end * date-time. @@ -213,4 +176,119 @@ public boolean isHedging() { public ProcedureRecommendation getRecommendedProcedure() { return this.recommendedProcedure; } + + /* + * Date and time are displayed when the procedure is recommended to be done at a specific point in time. + */ + @Generated + private String effectiveAt; + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the effectiveAt property: Date and time are displayed when the procedure is recommended to be done at a + * specific point in time. + * + * @return the effectiveAt value. + */ + @Generated + public String getEffectiveAt() { + return this.effectiveAt; + } + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isConditional", this.isConditional); + jsonWriter.writeBooleanField("isOption", this.isOption); + jsonWriter.writeBooleanField("isGuideline", this.isGuideline); + jsonWriter.writeBooleanField("isHedging", this.isHedging); + jsonWriter.writeJsonField("recommendedProcedure", this.recommendedProcedure); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("effectiveAt", this.effectiveAt); + jsonWriter.writeJsonField("effectivePeriod", this.effectivePeriod); + jsonWriter.writeArrayField("findings", this.findings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FollowupRecommendationInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FollowupRecommendationInference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FollowupRecommendationInference. + */ + @Generated + public static FollowupRecommendationInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + boolean isConditional = false; + boolean isOption = false; + boolean isGuideline = false; + boolean isHedging = false; + ProcedureRecommendation recommendedProcedure = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.FOLLOWUP_RECOMMENDATION; + String effectiveAt = null; + FhirR4Period effectivePeriod = null; + List findings = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("isConditional".equals(fieldName)) { + isConditional = reader.getBoolean(); + } else if ("isOption".equals(fieldName)) { + isOption = reader.getBoolean(); + } else if ("isGuideline".equals(fieldName)) { + isGuideline = reader.getBoolean(); + } else if ("isHedging".equals(fieldName)) { + isHedging = reader.getBoolean(); + } else if ("recommendedProcedure".equals(fieldName)) { + recommendedProcedure = ProcedureRecommendation.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("effectiveAt".equals(fieldName)) { + effectiveAt = reader.getString(); + } else if ("effectivePeriod".equals(fieldName)) { + effectivePeriod = FhirR4Period.fromJson(reader); + } else if ("findings".equals(fieldName)) { + findings = reader.readArray(reader1 -> RecommendationFinding.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + FollowupRecommendationInference deserializedFollowupRecommendationInference + = new FollowupRecommendationInference(isConditional, isOption, isGuideline, isHedging, + recommendedProcedure); + deserializedFollowupRecommendationInference.extension = extension; + deserializedFollowupRecommendationInference.kind = kind; + deserializedFollowupRecommendationInference.effectiveAt = effectiveAt; + deserializedFollowupRecommendationInference.effectivePeriod = effectivePeriod; + deserializedFollowupRecommendationInference.findings = findings; + return deserializedFollowupRecommendationInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationOptions.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationOptions.java index 9f2fe0edd7814..ce0108a940e38 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationOptions.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/FollowupRecommendationOptions.java @@ -5,26 +5,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Follow-up recommendation options. */ @Fluent -public final class FollowupRecommendationOptions { +public final class FollowupRecommendationOptions implements JsonSerializable { /* * Include/Exclude follow-up recommendations without a specific radiology procedure. Default is false. */ @Generated - @JsonProperty(value = "includeRecommendationsWithNoSpecifiedModality") private Boolean includeRecommendationsWithNoSpecifiedModality; /* * Include/Exclude follow-up recommendations in references to a guideline or article. Default is false. */ @Generated - @JsonProperty(value = "includeRecommendationsInReferences") private Boolean includeRecommendationsInReferences; /* @@ -33,7 +35,6 @@ public final class FollowupRecommendationOptions { * is false. */ @Generated - @JsonProperty(value = "provideFocusedSentenceEvidence") private Boolean provideFocusedSentenceEvidence; /** @@ -119,4 +120,51 @@ public FollowupRecommendationOptions setProvideFocusedSentenceEvidence(Boolean p this.provideFocusedSentenceEvidence = provideFocusedSentenceEvidence; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("includeRecommendationsWithNoSpecifiedModality", + this.includeRecommendationsWithNoSpecifiedModality); + jsonWriter.writeBooleanField("includeRecommendationsInReferences", this.includeRecommendationsInReferences); + jsonWriter.writeBooleanField("provideFocusedSentenceEvidence", this.provideFocusedSentenceEvidence); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FollowupRecommendationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FollowupRecommendationOptions if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FollowupRecommendationOptions. + */ + @Generated + public static FollowupRecommendationOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FollowupRecommendationOptions deserializedFollowupRecommendationOptions + = new FollowupRecommendationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("includeRecommendationsWithNoSpecifiedModality".equals(fieldName)) { + deserializedFollowupRecommendationOptions.includeRecommendationsWithNoSpecifiedModality + = reader.getNullable(JsonReader::getBoolean); + } else if ("includeRecommendationsInReferences".equals(fieldName)) { + deserializedFollowupRecommendationOptions.includeRecommendationsInReferences + = reader.getNullable(JsonReader::getBoolean); + } else if ("provideFocusedSentenceEvidence".equals(fieldName)) { + deserializedFollowupRecommendationOptions.provideFocusedSentenceEvidence + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedFollowupRecommendationOptions; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/GenericProcedureRecommendation.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/GenericProcedureRecommendation.java index f80744e136c6f..a396569b3812d 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/GenericProcedureRecommendation.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/GenericProcedureRecommendation.java @@ -5,21 +5,15 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * Generic procedure information. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = GenericProcedureRecommendation.class, - visible = true) -@JsonTypeName("genericProcedureRecommendation") @Immutable public final class GenericProcedureRecommendation extends ProcedureRecommendation { @@ -27,22 +21,18 @@ public final class GenericProcedureRecommendation extends ProcedureRecommendatio * Discriminator property for ProcedureRecommendation. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private String kind = "genericProcedureRecommendation"; /* * Procedure modality : SNOMED CT code. */ @Generated - @JsonProperty(value = "code") private final FhirR4CodeableConcept code; /* * Procedure description : MANAGEMENT PROCEDURE (PROCEDURE) or CONSULTATION (PROCEDURE) based on SNOMED CT. */ @Generated - @JsonProperty(value = "description") private String description; /** @@ -51,8 +41,7 @@ public final class GenericProcedureRecommendation extends ProcedureRecommendatio * @param code the code value to set. */ @Generated - @JsonCreator - private GenericProcedureRecommendation(@JsonProperty(value = "code") FhirR4CodeableConcept code) { + private GenericProcedureRecommendation(FhirR4CodeableConcept code) { this.code = code; } @@ -87,4 +76,75 @@ public FhirR4CodeableConcept getCode() { public String getDescription() { return this.description; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenericProcedureRecommendation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenericProcedureRecommendation if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenericProcedureRecommendation. + */ + @Generated + public static GenericProcedureRecommendation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + FhirR4CodeableConcept code = null; + String kind = "genericProcedureRecommendation"; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("code".equals(fieldName)) { + code = FhirR4CodeableConcept.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + GenericProcedureRecommendation deserializedGenericProcedureRecommendation + = new GenericProcedureRecommendation(code); + deserializedGenericProcedureRecommendation.extension = extension; + deserializedGenericProcedureRecommendation.kind = kind; + deserializedGenericProcedureRecommendation.description = description; + return deserializedGenericProcedureRecommendation; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedure.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedure.java index 75c109495288e..4c470ba8d65eb 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedure.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedure.java @@ -5,48 +5,46 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Imaging procedure. */ @Immutable -public final class ImagingProcedure { +public final class ImagingProcedure implements JsonSerializable { /* * Modality : SNOMED CT code. */ @Generated - @JsonProperty(value = "modality") private final FhirR4CodeableConcept modality; /* * Anatomy : SNOMED CT code. */ @Generated - @JsonProperty(value = "anatomy") private final FhirR4CodeableConcept anatomy; /* * Laterality : SNOMED CT code. */ @Generated - @JsonProperty(value = "laterality") private FhirR4CodeableConcept laterality; /* * Contrast : see RadiologyCodeWithTypes (below). */ @Generated - @JsonProperty(value = "contrast") private RadiologyCodeWithTypes contrast; /* * View : see RadiologyCodeWithTypes (below). */ @Generated - @JsonProperty(value = "view") private RadiologyCodeWithTypes view; /** @@ -56,9 +54,7 @@ public final class ImagingProcedure { * @param anatomy the anatomy value to set. */ @Generated - @JsonCreator - private ImagingProcedure(@JsonProperty(value = "modality") FhirR4CodeableConcept modality, - @JsonProperty(value = "anatomy") FhirR4CodeableConcept anatomy) { + private ImagingProcedure(FhirR4CodeableConcept modality, FhirR4CodeableConcept anatomy) { this.modality = modality; this.anatomy = anatomy; } @@ -112,4 +108,61 @@ public RadiologyCodeWithTypes getContrast() { public RadiologyCodeWithTypes getView() { return this.view; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("modality", this.modality); + jsonWriter.writeJsonField("anatomy", this.anatomy); + jsonWriter.writeJsonField("laterality", this.laterality); + jsonWriter.writeJsonField("contrast", this.contrast); + jsonWriter.writeJsonField("view", this.view); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImagingProcedure from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImagingProcedure if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImagingProcedure. + */ + @Generated + public static ImagingProcedure fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4CodeableConcept modality = null; + FhirR4CodeableConcept anatomy = null; + FhirR4CodeableConcept laterality = null; + RadiologyCodeWithTypes contrast = null; + RadiologyCodeWithTypes view = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("modality".equals(fieldName)) { + modality = FhirR4CodeableConcept.fromJson(reader); + } else if ("anatomy".equals(fieldName)) { + anatomy = FhirR4CodeableConcept.fromJson(reader); + } else if ("laterality".equals(fieldName)) { + laterality = FhirR4CodeableConcept.fromJson(reader); + } else if ("contrast".equals(fieldName)) { + contrast = RadiologyCodeWithTypes.fromJson(reader); + } else if ("view".equals(fieldName)) { + view = RadiologyCodeWithTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ImagingProcedure deserializedImagingProcedure = new ImagingProcedure(modality, anatomy); + deserializedImagingProcedure.laterality = laterality; + deserializedImagingProcedure.contrast = contrast; + deserializedImagingProcedure.view = view; + return deserializedImagingProcedure; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedureRecommendation.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedureRecommendation.java index cdca36f002a81..599bad731f698 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedureRecommendation.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ImagingProcedureRecommendation.java @@ -5,22 +5,15 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Imaging procedures. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ImagingProcedureRecommendation.class, - visible = true) -@JsonTypeName("imagingProcedureRecommendation") @Immutable public final class ImagingProcedureRecommendation extends ProcedureRecommendation { @@ -28,22 +21,18 @@ public final class ImagingProcedureRecommendation extends ProcedureRecommendatio * Discriminator property for ProcedureRecommendation. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private String kind = "imagingProcedureRecommendation"; /* * LOINC codes for the procedure. */ @Generated - @JsonProperty(value = "procedureCodes") private List procedureCodes; /* * Imaging procedures. */ @Generated - @JsonProperty(value = "imagingProcedures") private final List imagingProcedures; /** @@ -52,9 +41,7 @@ public final class ImagingProcedureRecommendation extends ProcedureRecommendatio * @param imagingProcedures the imagingProcedures value to set. */ @Generated - @JsonCreator - private ImagingProcedureRecommendation( - @JsonProperty(value = "imagingProcedures") List imagingProcedures) { + private ImagingProcedureRecommendation(List imagingProcedures) { this.imagingProcedures = imagingProcedures; } @@ -88,4 +75,77 @@ public List getProcedureCodes() { public List getImagingProcedures() { return this.imagingProcedures; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("imagingProcedures", this.imagingProcedures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeArrayField("procedureCodes", this.procedureCodes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImagingProcedureRecommendation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImagingProcedureRecommendation if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImagingProcedureRecommendation. + */ + @Generated + public static ImagingProcedureRecommendation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + List imagingProcedures = null; + String kind = "imagingProcedureRecommendation"; + List procedureCodes = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("imagingProcedures".equals(fieldName)) { + imagingProcedures = reader.readArray(reader1 -> ImagingProcedure.fromJson(reader1)); + } else if ("kind".equals(fieldName)) { + kind = reader.getString(); + } else if ("procedureCodes".equals(fieldName)) { + procedureCodes = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + ImagingProcedureRecommendation deserializedImagingProcedureRecommendation + = new ImagingProcedureRecommendation(imagingProcedures); + deserializedImagingProcedureRecommendation.extension = extension; + deserializedImagingProcedureRecommendation.kind = kind; + deserializedImagingProcedureRecommendation.procedureCodes = procedureCodes; + return deserializedImagingProcedureRecommendation; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/JobStatus.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/JobStatus.java index d94361b0da526..bf17c7cc137a0 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/JobStatus.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/JobStatus.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -60,7 +59,6 @@ public JobStatus() { * @return the corresponding JobStatus. */ @Generated - @JsonCreator public static JobStatus fromString(String name) { return fromString(name, JobStatus.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyInference.java index 4fea067ca7376..e76b2dd2a5ab4 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyInference.java @@ -5,23 +5,17 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * A laterality mismatch occurs when there is a discrepancy between the clinical documentation and the ordered procedure * (orderLateralityMismatch), a contradiction within the clinical document (textLateralityContradiction), or when no * laterality is mentioned (textLateralityMissing). */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = LateralityDiscrepancyInference.class, - visible = true) -@JsonTypeName("lateralityDiscrepancy") @Immutable public final class LateralityDiscrepancyInference extends RadiologyInsightsInference { @@ -29,22 +23,18 @@ public final class LateralityDiscrepancyInference extends RadiologyInsightsInfer * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY; /* * Laterality indication : SNOMED CT code for laterality qualifier value. */ @Generated - @JsonProperty(value = "lateralityIndication") private FhirR4CodeableConcept lateralityIndication; /* * Mismatch type : orderLateralityMismatch, textLateralityContradiction, textLateralityMissing. */ @Generated - @JsonProperty(value = "discrepancyType") private final LateralityDiscrepancyType discrepancyType; /** @@ -53,9 +43,7 @@ public final class LateralityDiscrepancyInference extends RadiologyInsightsInfer * @param discrepancyType the discrepancyType value to set. */ @Generated - @JsonCreator - private LateralityDiscrepancyInference( - @JsonProperty(value = "discrepancyType") LateralityDiscrepancyType discrepancyType) { + private LateralityDiscrepancyInference(LateralityDiscrepancyType discrepancyType) { this.discrepancyType = discrepancyType; } @@ -90,4 +78,76 @@ public FhirR4CodeableConcept getLateralityIndication() { public LateralityDiscrepancyType getDiscrepancyType() { return this.discrepancyType; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("discrepancyType", + this.discrepancyType == null ? null : this.discrepancyType.toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("lateralityIndication", this.lateralityIndication); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LateralityDiscrepancyInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LateralityDiscrepancyInference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LateralityDiscrepancyInference. + */ + @Generated + public static LateralityDiscrepancyInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + LateralityDiscrepancyType discrepancyType = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.LATERALITY_DISCREPANCY; + FhirR4CodeableConcept lateralityIndication = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("discrepancyType".equals(fieldName)) { + discrepancyType = LateralityDiscrepancyType.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("lateralityIndication".equals(fieldName)) { + lateralityIndication = FhirR4CodeableConcept.fromJson(reader); + } else { + reader.skipChildren(); + } + } + LateralityDiscrepancyInference deserializedLateralityDiscrepancyInference + = new LateralityDiscrepancyInference(discrepancyType); + deserializedLateralityDiscrepancyInference.extension = extension; + deserializedLateralityDiscrepancyInference.kind = kind; + deserializedLateralityDiscrepancyInference.lateralityIndication = lateralityIndication; + return deserializedLateralityDiscrepancyInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyType.java index 3574d73956d5e..a8fb60ebeeea6 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LateralityDiscrepancyType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -49,7 +48,6 @@ public LateralityDiscrepancyType() { * @return the corresponding LateralityDiscrepancyType. */ @Generated - @JsonCreator public static LateralityDiscrepancyType fromString(String name) { return fromString(name, LateralityDiscrepancyType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LimitedOrderDiscrepancyInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LimitedOrderDiscrepancyInference.java index 88fd8bf52493d..02ad549f2f54a 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LimitedOrderDiscrepancyInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/LimitedOrderDiscrepancyInference.java @@ -5,23 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * A limited order discrepancy occurs when there is a limited order, but all body parts and measurements that are needed * for a complete order are present in the document. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = LimitedOrderDiscrepancyInference.class, - visible = true) -@JsonTypeName("limitedOrderDiscrepancy") @Immutable public final class LimitedOrderDiscrepancyInference extends RadiologyInsightsInference { @@ -29,29 +22,24 @@ public final class LimitedOrderDiscrepancyInference extends RadiologyInsightsInf * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY; /* * Order type : CPT ultrasound complete code for abdomen, retroperitoneal, pelvis or breast. */ @Generated - @JsonProperty(value = "orderType") private final FhirR4CodeableConcept orderType; /* * List of body parts found in the document : SNOMED CT codes. */ @Generated - @JsonProperty(value = "presentBodyParts") private List presentBodyParts; /* * List of body parts that are measured according to the document : SNOMED CT codes. */ @Generated - @JsonProperty(value = "presentBodyPartMeasurements") private List presentBodyPartMeasurements; /** @@ -60,8 +48,7 @@ public final class LimitedOrderDiscrepancyInference extends RadiologyInsightsInf * @param orderType the orderType value to set. */ @Generated - @JsonCreator - private LimitedOrderDiscrepancyInference(@JsonProperty(value = "orderType") FhirR4CodeableConcept orderType) { + private LimitedOrderDiscrepancyInference(FhirR4CodeableConcept orderType) { this.orderType = orderType; } @@ -107,4 +94,82 @@ public List getPresentBodyParts() { public List getPresentBodyPartMeasurements() { return this.presentBodyPartMeasurements; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("orderType", this.orderType); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("presentBodyParts", this.presentBodyParts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("presentBodyPartMeasurements", this.presentBodyPartMeasurements, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LimitedOrderDiscrepancyInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LimitedOrderDiscrepancyInference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LimitedOrderDiscrepancyInference. + */ + @Generated + public static LimitedOrderDiscrepancyInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + FhirR4CodeableConcept orderType = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.LIMITED_ORDER_DISCREPANCY; + List presentBodyParts = null; + List presentBodyPartMeasurements = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("orderType".equals(fieldName)) { + orderType = FhirR4CodeableConcept.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("presentBodyParts".equals(fieldName)) { + presentBodyParts = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else if ("presentBodyPartMeasurements".equals(fieldName)) { + presentBodyPartMeasurements = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + LimitedOrderDiscrepancyInference deserializedLimitedOrderDiscrepancyInference + = new LimitedOrderDiscrepancyInference(orderType); + deserializedLimitedOrderDiscrepancyInference.extension = extension; + deserializedLimitedOrderDiscrepancyInference.kind = kind; + deserializedLimitedOrderDiscrepancyInference.presentBodyParts = presentBodyParts; + deserializedLimitedOrderDiscrepancyInference.presentBodyPartMeasurements = presentBodyPartMeasurements; + return deserializedLimitedOrderDiscrepancyInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/MedicalProfessionalType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/MedicalProfessionalType.java index ea9fde7b4fadb..58cd0418dc920 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/MedicalProfessionalType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/MedicalProfessionalType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -60,7 +59,6 @@ public MedicalProfessionalType() { * @return the corresponding MedicalProfessionalType. */ @Generated - @JsonCreator public static MedicalProfessionalType fromString(String name) { return fromString(name, MedicalProfessionalType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ObservationStatusCodeType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ObservationStatusCodeType.java index ea27ca699d290..c2d11bc1e7f02 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ObservationStatusCodeType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ObservationStatusCodeType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -82,7 +81,6 @@ public ObservationStatusCodeType() { * @return the corresponding ObservationStatusCodeType. */ @Generated - @JsonCreator public static ObservationStatusCodeType fromString(String name) { return fromString(name, ObservationStatusCodeType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/OrderedProcedure.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/OrderedProcedure.java index 5792d645a82b5..f74102f3e3e17 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/OrderedProcedure.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/OrderedProcedure.java @@ -5,34 +5,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Procedure information. */ @Fluent -public final class OrderedProcedure { +public final class OrderedProcedure implements JsonSerializable { /* * Additional Content defined by implementations */ @Generated - @JsonProperty(value = "extension") private List extension; /* * Procedure code */ @Generated - @JsonProperty(value = "code") private FhirR4CodeableConcept code; /* * Procedure description */ @Generated - @JsonProperty(value = "description") private String description; /** @@ -107,4 +108,47 @@ public OrderedProcedure setDescription(String description) { this.description = description; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("extension", this.extension, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrderedProcedure from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrderedProcedure if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OrderedProcedure. + */ + @Generated + public static OrderedProcedure fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrderedProcedure deserializedOrderedProcedure = new OrderedProcedure(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + deserializedOrderedProcedure.code = FhirR4CodeableConcept.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedOrderedProcedure.description = reader.getString(); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedOrderedProcedure.extension = extension; + } else { + reader.skipChildren(); + } + } + return deserializedOrderedProcedure; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDetails.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDetails.java index 520ea029114f5..ee4e2d7a19c9f 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDetails.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDetails.java @@ -5,35 +5,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.LocalDate; import java.util.List; +import java.util.Objects; /** * Patient structured information, including demographics and known structured clinical information. */ @Fluent -public final class PatientDetails { +public final class PatientDetails implements JsonSerializable { /* * The patient's sex. */ @Generated - @JsonProperty(value = "sex") private PatientSex sex; /* * The patient's date of birth. */ @Generated - @JsonProperty(value = "birthDate") private LocalDate birthDate; /* * Known clinical information for the patient, structured. */ @Generated - @JsonProperty(value = "clinicalInfo") private List clinicalInfo; /** @@ -108,4 +110,48 @@ public PatientDetails setClinicalInfo(List clinicalInfo) { this.clinicalInfo = clinicalInfo; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sex", this.sex == null ? null : this.sex.toString()); + jsonWriter.writeStringField("birthDate", Objects.toString(this.birthDate, null)); + jsonWriter.writeArrayField("clinicalInfo", this.clinicalInfo, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatientDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatientDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatientDetails. + */ + @Generated + public static PatientDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatientDetails deserializedPatientDetails = new PatientDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("sex".equals(fieldName)) { + deserializedPatientDetails.sex = PatientSex.fromString(reader.getString()); + } else if ("birthDate".equals(fieldName)) { + deserializedPatientDetails.birthDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("clinicalInfo".equals(fieldName)) { + List clinicalInfo = reader.readArray(reader1 -> FhirR4Resource.fromJson(reader1)); + deserializedPatientDetails.clinicalInfo = clinicalInfo; + } else { + reader.skipChildren(); + } + } + return deserializedPatientDetails; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDocument.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDocument.java index cd7a891dd1d80..9c63a8a52c3e4 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDocument.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientDocument.java @@ -5,78 +5,68 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * A clinical document related to a patient. Document here is in the wide sense - not just a text document (note). */ @Fluent -public final class PatientDocument { +public final class PatientDocument implements JsonSerializable { /* * The type of the patient document, such as 'note' (text document) or 'fhirBundle' (FHIR JSON document). */ @Generated - @JsonProperty(value = "type") private final DocumentType type; /* * The type of the clinical document. */ @Generated - @JsonProperty(value = "clinicalType") private ClinicalDocumentType clinicalType; /* * A given identifier for the document. Has to be unique across all documents for a single patient. */ @Generated - @JsonProperty(value = "id") private final String id; /* * A 2 letter ISO 639-1 representation of the language of the document. */ @Generated - @JsonProperty(value = "language") private String language; - /* - * The date and time when the document was created. - */ - @Generated - @JsonProperty(value = "createdDateTime") - private OffsetDateTime createdDateTime; - /* * Document author(s) */ @Generated - @JsonProperty(value = "authors") private List authors; /* * specialty type the document */ @Generated - @JsonProperty(value = "specialtyType") private SpecialtyType specialtyType; /* * Administrative metadata for the document. */ @Generated - @JsonProperty(value = "administrativeMetadata") private DocumentAdministrativeMetadata administrativeMetadata; /* * The content of the patient document. */ @Generated - @JsonProperty(value = "content") private final DocumentContent content; /** @@ -87,9 +77,7 @@ public final class PatientDocument { * @param content the content value to set. */ @Generated - @JsonCreator - public PatientDocument(@JsonProperty(value = "type") DocumentType type, @JsonProperty(value = "id") String id, - @JsonProperty(value = "content") DocumentContent content) { + public PatientDocument(DocumentType type, String id, DocumentContent content) { this.type = type; this.id = id; this.content = content; @@ -161,28 +149,6 @@ public PatientDocument setLanguage(String language) { return this; } - /** - * Get the createdDateTime property: The date and time when the document was created. - * - * @return the createdDateTime value. - */ - @Generated - public OffsetDateTime getCreatedDateTime() { - return this.createdDateTime; - } - - /** - * Set the createdDateTime property: The date and time when the document was created. - * - * @param createdDateTime the createdDateTime value to set. - * @return the PatientDocument object itself. - */ - @Generated - public PatientDocument setCreatedDateTime(OffsetDateTime createdDateTime) { - this.createdDateTime = createdDateTime; - return this; - } - /** * Get the authors property: Document author(s). * @@ -258,4 +224,110 @@ public PatientDocument setAdministrativeMetadata(DocumentAdministrativeMetadata public DocumentContent getContent() { return this.content; } + + /* + * The date and time when the document was created. + */ + @Generated + private OffsetDateTime createdAt; + + /** + * Get the createdAt property: The date and time when the document was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: The date and time when the document was created. + * + * @param createdAt the createdAt value to set. + * @return the PatientDocument object itself. + */ + @Generated + public PatientDocument setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("content", this.content); + jsonWriter.writeStringField("clinicalType", this.clinicalType == null ? null : this.clinicalType.toString()); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeArrayField("authors", this.authors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("specialtyType", this.specialtyType == null ? null : this.specialtyType.toString()); + jsonWriter.writeJsonField("administrativeMetadata", this.administrativeMetadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatientDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatientDocument if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatientDocument. + */ + @Generated + public static PatientDocument fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DocumentType type = null; + String id = null; + DocumentContent content = null; + ClinicalDocumentType clinicalType = null; + String language = null; + OffsetDateTime createdAt = null; + List authors = null; + SpecialtyType specialtyType = null; + DocumentAdministrativeMetadata administrativeMetadata = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + type = DocumentType.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("content".equals(fieldName)) { + content = DocumentContent.fromJson(reader); + } else if ("clinicalType".equals(fieldName)) { + clinicalType = ClinicalDocumentType.fromString(reader.getString()); + } else if ("language".equals(fieldName)) { + language = reader.getString(); + } else if ("createdAt".equals(fieldName)) { + createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("authors".equals(fieldName)) { + authors = reader.readArray(reader1 -> DocumentAuthor.fromJson(reader1)); + } else if ("specialtyType".equals(fieldName)) { + specialtyType = SpecialtyType.fromString(reader.getString()); + } else if ("administrativeMetadata".equals(fieldName)) { + administrativeMetadata = DocumentAdministrativeMetadata.fromJson(reader); + } else { + reader.skipChildren(); + } + } + PatientDocument deserializedPatientDocument = new PatientDocument(type, id, content); + deserializedPatientDocument.clinicalType = clinicalType; + deserializedPatientDocument.language = language; + deserializedPatientDocument.createdAt = createdAt; + deserializedPatientDocument.authors = authors; + deserializedPatientDocument.specialtyType = specialtyType; + deserializedPatientDocument.administrativeMetadata = administrativeMetadata; + return deserializedPatientDocument; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientEncounter.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientEncounter.java new file mode 100644 index 0000000000000..4fd4ad695d997 --- /dev/null +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientEncounter.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.health.insights.radiologyinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * visit/encounter information. + */ +@Fluent +public final class PatientEncounter implements JsonSerializable { + /* + * The id of the visit. + */ + @Generated + private final String id; + + /* + * 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. + */ + @Generated + private TimePeriod period; + + /* + * The class of the encounter. + */ + @Generated + private EncounterClass classProperty; + + /** + * Creates an instance of PatientEncounter class. + * + * @param id the id value to set. + */ + @Generated + public PatientEncounter(String id) { + this.id = id; + } + + /** + * Get the id property: The id of the visit. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the period property: 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. + * + * @return the period value. + */ + @Generated + public TimePeriod getPeriod() { + return this.period; + } + + /** + * Set the period property: 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 period the period value to set. + * @return the PatientEncounter object itself. + */ + @Generated + public PatientEncounter setPeriod(TimePeriod period) { + this.period = period; + return this; + } + + /** + * Get the classProperty property: The class of the encounter. + * + * @return the classProperty value. + */ + @Generated + public EncounterClass getClassProperty() { + return this.classProperty; + } + + /** + * Set the classProperty property: The class of the encounter. + * + * @param classProperty the classProperty value to set. + * @return the PatientEncounter object itself. + */ + @Generated + public PatientEncounter setClassProperty(EncounterClass classProperty) { + this.classProperty = classProperty; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("period", this.period); + jsonWriter.writeStringField("class", this.classProperty == null ? null : this.classProperty.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatientEncounter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatientEncounter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatientEncounter. + */ + @Generated + public static PatientEncounter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + TimePeriod period = null; + EncounterClass classProperty = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("period".equals(fieldName)) { + period = TimePeriod.fromJson(reader); + } else if ("class".equals(fieldName)) { + classProperty = EncounterClass.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + PatientEncounter deserializedPatientEncounter = new PatientEncounter(id); + deserializedPatientEncounter.period = period; + deserializedPatientEncounter.classProperty = classProperty; + + return deserializedPatientEncounter; + }); + } +} diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientRecord.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientRecord.java index fa1de5d7e97ea..0193ed0b83cd9 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientRecord.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientRecord.java @@ -5,42 +5,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * A patient record, including their clinical information and data. */ @Fluent -public final class PatientRecord { +public final class PatientRecord implements JsonSerializable { /* * A given identifier for the patient. Has to be unique across all patients in a single request. */ @Generated - @JsonProperty(value = "id") private final String id; - /* - * Patient structured information, including demographics and known structured clinical information. - */ - @Generated - @JsonProperty(value = "info") - private PatientDetails info; - /* * Patient encounters/visits. */ @Generated - @JsonProperty(value = "encounters") - private List encounters; + private List encounters; /* * Patient unstructured clinical data, given as documents. */ @Generated - @JsonProperty(value = "patientDocuments") private List patientDocuments; /** @@ -49,8 +42,7 @@ public final class PatientRecord { * @param id the id value to set. */ @Generated - @JsonCreator - public PatientRecord(@JsonProperty(value = "id") String id) { + public PatientRecord(String id) { this.id = id; } @@ -65,37 +57,13 @@ public String getId() { return this.id; } - /** - * Get the info property: Patient structured information, including demographics and known structured clinical - * information. - * - * @return the info value. - */ - @Generated - public PatientDetails getInfo() { - return this.info; - } - - /** - * Set the info property: Patient structured information, including demographics and known structured clinical - * information. - * - * @param info the info value to set. - * @return the PatientRecord object itself. - */ - @Generated - public PatientRecord setInfo(PatientDetails info) { - this.info = info; - return this; - } - /** * Get the encounters property: Patient encounters/visits. * * @return the encounters value. */ @Generated - public List getEncounters() { + public List getEncounters() { return this.encounters; } @@ -106,7 +74,7 @@ public List getEncounters() { * @return the PatientRecord object itself. */ @Generated - public PatientRecord setEncounters(List encounters) { + public PatientRecord setEncounters(List encounters) { this.encounters = encounters; return this; } @@ -132,4 +100,88 @@ public PatientRecord setPatientDocuments(List patientDocuments) this.patientDocuments = patientDocuments; return this; } + + /* + * Patient structured information, including demographics and known structured clinical information. + */ + @Generated + private PatientDetails details; + + /** + * Get the details property: Patient structured information, including demographics and known structured clinical + * information. + * + * @return the details value. + */ + @Generated + public PatientDetails getDetails() { + return this.details; + } + + /** + * Set the details property: Patient structured information, including demographics and known structured clinical + * information. + * + * @param details the details value to set. + * @return the PatientRecord object itself. + */ + @Generated + public PatientRecord setDetails(PatientDetails details) { + this.details = details; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("details", this.details); + jsonWriter.writeArrayField("encounters", this.encounters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("patientDocuments", this.patientDocuments, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatientRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatientRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatientRecord. + */ + @Generated + public static PatientRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + PatientDetails details = null; + List encounters = null; + List patientDocuments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("details".equals(fieldName)) { + details = PatientDetails.fromJson(reader); + } else if ("encounters".equals(fieldName)) { + encounters = reader.readArray(reader1 -> PatientEncounter.fromJson(reader1)); + } else if ("patientDocuments".equals(fieldName)) { + patientDocuments = reader.readArray(reader1 -> PatientDocument.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + PatientRecord deserializedPatientRecord = new PatientRecord(id); + deserializedPatientRecord.details = details; + deserializedPatientRecord.encounters = encounters; + deserializedPatientRecord.patientDocuments = patientDocuments; + return deserializedPatientRecord; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientSex.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientSex.java index 72fcac8c6b441..5456a991c20a9 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientSex.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/PatientSex.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public PatientSex() { * @return the corresponding PatientSex. */ @Generated - @JsonCreator public static PatientSex fromString(String name) { return fromString(name, PatientSex.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ProcedureRecommendation.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ProcedureRecommendation.java index aacac639c0e82..c2aaa43a9c325 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ProcedureRecommendation.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ProcedureRecommendation.java @@ -5,33 +5,23 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * The procedure recommendation can be a generic procedure or an imaging procedure. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = ProcedureRecommendation.class, - visible = true) -@JsonTypeName("ProcedureRecommendation") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "genericProcedureRecommendation", value = GenericProcedureRecommendation.class), - @JsonSubTypes.Type(name = "imagingProcedureRecommendation", value = ImagingProcedureRecommendation.class) }) @Immutable -public class ProcedureRecommendation { +public class ProcedureRecommendation implements JsonSerializable { /* * Discriminator property for ProcedureRecommendation. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private String kind = "ProcedureRecommendation"; /** @@ -50,4 +40,101 @@ protected ProcedureRecommendation() { public String getKind() { return this.kind; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + public List getExtension() { + return this.extension; + } + + /** + * Set the extension property: Additional Content defined by implementations. + * + * @param extension the extension value to set. + * @return the ProcedureRecommendation object itself. + */ + @Generated + ProcedureRecommendation setExtension(List extension) { + this.extension = extension; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeArrayField("extension", this.extension, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProcedureRecommendation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProcedureRecommendation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProcedureRecommendation. + */ + @Generated + public static ProcedureRecommendation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("genericProcedureRecommendation".equals(discriminatorValue)) { + return GenericProcedureRecommendation.fromJson(readerToUse.reset()); + } else if ("imagingProcedureRecommendation".equals(discriminatorValue)) { + return ImagingProcedureRecommendation.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static ProcedureRecommendation fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProcedureRecommendation deserializedProcedureRecommendation = new ProcedureRecommendation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedProcedureRecommendation.kind = reader.getString(); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedProcedureRecommendation.extension = extension; + } else { + reader.skipChildren(); + } + } + return deserializedProcedureRecommendation; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyCodeWithTypes.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyCodeWithTypes.java index a944714c701d0..e9ac7e3e1a299 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyCodeWithTypes.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyCodeWithTypes.java @@ -5,22 +5,24 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Radiology code with types : used in imaging procedure recommendation for contrast and view. */ @Immutable -public final class RadiologyCodeWithTypes { +public final class RadiologyCodeWithTypes implements JsonSerializable { /* * 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. */ @Generated - @JsonProperty(value = "code") private final FhirR4CodeableConcept code; /* @@ -28,7 +30,6 @@ public final class RadiologyCodeWithTypes { * views, it will specify the types of views, such as lateral and frontal, etc. */ @Generated - @JsonProperty(value = "types") private final List types; /** @@ -38,9 +39,7 @@ public final class RadiologyCodeWithTypes { * @param types the types value to set. */ @Generated - @JsonCreator - private RadiologyCodeWithTypes(@JsonProperty(value = "code") FhirR4CodeableConcept code, - @JsonProperty(value = "types") List types) { + private RadiologyCodeWithTypes(FhirR4CodeableConcept code, List types) { this.code = code; this.types = types; } @@ -66,4 +65,45 @@ public FhirR4CodeableConcept getCode() { public List getTypes() { return this.types; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeArrayField("types", this.types, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyCodeWithTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyCodeWithTypes if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiologyCodeWithTypes. + */ + @Generated + public static RadiologyCodeWithTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FhirR4CodeableConcept code = null; + List types = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + code = FhirR4CodeableConcept.fromJson(reader); + } else if ("types".equals(fieldName)) { + types = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new RadiologyCodeWithTypes(code, types); + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsData.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsData.java index 686ea25d2e460..81d442cbfd915 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsData.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsData.java @@ -5,28 +5,29 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Contains the list of patients, and configuration data. */ @Fluent -public final class RadiologyInsightsData { +public final class RadiologyInsightsData implements JsonSerializable { /* * The list of patients, including their clinical information and data. */ @Generated - @JsonProperty(value = "patients") private final List patients; /* * Configuration affecting the Radiology Insights model's inference. */ @Generated - @JsonProperty(value = "configuration") private RadiologyInsightsModelConfiguration configuration; /** @@ -35,8 +36,7 @@ public final class RadiologyInsightsData { * @param patients the patients value to set. */ @Generated - @JsonCreator - public RadiologyInsightsData(@JsonProperty(value = "patients") List patients) { + public RadiologyInsightsData(List patients) { this.patients = patients; } @@ -71,4 +71,47 @@ public RadiologyInsightsData setConfiguration(RadiologyInsightsModelConfiguratio this.configuration = configuration; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("patients", this.patients, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("configuration", this.configuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsData if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiologyInsightsData. + */ + @Generated + public static RadiologyInsightsData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List patients = null; + RadiologyInsightsModelConfiguration configuration = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("patients".equals(fieldName)) { + patients = reader.readArray(reader1 -> PatientRecord.fromJson(reader1)); + } else if ("configuration".equals(fieldName)) { + configuration = RadiologyInsightsModelConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + RadiologyInsightsData deserializedRadiologyInsightsData = new RadiologyInsightsData(patients); + deserializedRadiologyInsightsData.configuration = configuration; + return deserializedRadiologyInsightsData; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInference.java index 58973c2ea1ec5..3a8dc34b99f3d 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInference.java @@ -5,11 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -25,32 +25,13 @@ * - RadiologyProcedure * - FollowupCommunication. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = RadiologyInsightsInference.class, - visible = true) -@JsonTypeName("RadiologyInsightsInference") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "ageMismatch", value = AgeMismatchInference.class), - @JsonSubTypes.Type(name = "sexMismatch", value = SexMismatchInference.class), - @JsonSubTypes.Type(name = "lateralityDiscrepancy", value = LateralityDiscrepancyInference.class), - @JsonSubTypes.Type(name = "completeOrderDiscrepancy", value = CompleteOrderDiscrepancyInference.class), - @JsonSubTypes.Type(name = "limitedOrderDiscrepancy", value = LimitedOrderDiscrepancyInference.class), - @JsonSubTypes.Type(name = "finding", value = FindingInference.class), - @JsonSubTypes.Type(name = "criticalResult", value = CriticalResultInference.class), - @JsonSubTypes.Type(name = "radiologyProcedure", value = RadiologyProcedureInference.class), - @JsonSubTypes.Type(name = "followupRecommendation", value = FollowupRecommendationInference.class), - @JsonSubTypes.Type(name = "followupCommunication", value = FollowupCommunicationInference.class) }) @Immutable -public class RadiologyInsightsInference { +public class RadiologyInsightsInference implements JsonSerializable { /* * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.fromString("RadiologyInsightsInference"); @@ -58,7 +39,6 @@ public class RadiologyInsightsInference { * Additional Content defined by implementations */ @Generated - @JsonProperty(value = "extension") private List extension; /** @@ -87,4 +67,102 @@ public RadiologyInsightsInferenceType getKind() { public List getExtension() { return this.extension; } + + /** + * Set the extension property: Additional Content defined by implementations. + * + * @param extension the extension value to set. + * @return the RadiologyInsightsInference object itself. + */ + @Generated + RadiologyInsightsInference setExtension(List extension) { + this.extension = extension; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("extension", this.extension, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsInference if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RadiologyInsightsInference. + */ + @Generated + public static RadiologyInsightsInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ageMismatch".equals(discriminatorValue)) { + return AgeMismatchInference.fromJson(readerToUse.reset()); + } else if ("sexMismatch".equals(discriminatorValue)) { + return SexMismatchInference.fromJson(readerToUse.reset()); + } else if ("lateralityDiscrepancy".equals(discriminatorValue)) { + return LateralityDiscrepancyInference.fromJson(readerToUse.reset()); + } else if ("completeOrderDiscrepancy".equals(discriminatorValue)) { + return CompleteOrderDiscrepancyInference.fromJson(readerToUse.reset()); + } else if ("limitedOrderDiscrepancy".equals(discriminatorValue)) { + return LimitedOrderDiscrepancyInference.fromJson(readerToUse.reset()); + } else if ("finding".equals(discriminatorValue)) { + return FindingInference.fromJson(readerToUse.reset()); + } else if ("criticalResult".equals(discriminatorValue)) { + return CriticalResultInference.fromJson(readerToUse.reset()); + } else if ("radiologyProcedure".equals(discriminatorValue)) { + return RadiologyProcedureInference.fromJson(readerToUse.reset()); + } else if ("followupRecommendation".equals(discriminatorValue)) { + return FollowupRecommendationInference.fromJson(readerToUse.reset()); + } else if ("followupCommunication".equals(discriminatorValue)) { + return FollowupCommunicationInference.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static RadiologyInsightsInference fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RadiologyInsightsInference deserializedRadiologyInsightsInference = new RadiologyInsightsInference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedRadiologyInsightsInference.kind + = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("extension".equals(fieldName)) { + List extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + deserializedRadiologyInsightsInference.extension = extension; + } else { + reader.skipChildren(); + } + } + return deserializedRadiologyInsightsInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceOptions.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceOptions.java index d65ad9828f013..c0f526fe42452 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceOptions.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceOptions.java @@ -5,26 +5,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Options regarding follow up recommendation inferences and finding inferences. */ @Fluent -public final class RadiologyInsightsInferenceOptions { +public final class RadiologyInsightsInferenceOptions implements JsonSerializable { /* * Follow-up recommendation options. */ @Generated - @JsonProperty(value = "followupRecommendationOptions") private FollowupRecommendationOptions followupRecommendationOptions; /* * Finding options. */ @Generated - @JsonProperty(value = "findingOptions") private FindingOptions findingOptions; /** @@ -78,4 +80,45 @@ public RadiologyInsightsInferenceOptions setFindingOptions(FindingOptions findin this.findingOptions = findingOptions; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("followupRecommendationOptions", this.followupRecommendationOptions); + jsonWriter.writeJsonField("findingOptions", this.findingOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsInferenceOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsInferenceOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RadiologyInsightsInferenceOptions. + */ + @Generated + public static RadiologyInsightsInferenceOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RadiologyInsightsInferenceOptions deserializedRadiologyInsightsInferenceOptions + = new RadiologyInsightsInferenceOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("followupRecommendationOptions".equals(fieldName)) { + deserializedRadiologyInsightsInferenceOptions.followupRecommendationOptions + = FollowupRecommendationOptions.fromJson(reader); + } else if ("findingOptions".equals(fieldName)) { + deserializedRadiologyInsightsInferenceOptions.findingOptions = FindingOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedRadiologyInsightsInferenceOptions; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceResult.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceResult.java index c5a70e1f5b0f1..f80785b8b5caa 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceResult.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceResult.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -14,20 +17,18 @@ * 'result' will contain an instance of RadiologyInsightsInferenceResult. */ @Immutable -public final class RadiologyInsightsInferenceResult { +public final class RadiologyInsightsInferenceResult implements JsonSerializable { /* * Results for the patients given in the request. */ @Generated - @JsonProperty(value = "patientResults") private final List patientResults; /* * The version of the model used for inference, expressed as the model date. */ @Generated - @JsonProperty(value = "modelVersion") private final String modelVersion; /** @@ -37,10 +38,7 @@ public final class RadiologyInsightsInferenceResult { * @param modelVersion the modelVersion value to set. */ @Generated - @JsonCreator - private RadiologyInsightsInferenceResult( - @JsonProperty(value = "patientResults") List patientResults, - @JsonProperty(value = "modelVersion") String modelVersion) { + private RadiologyInsightsInferenceResult(List patientResults, String modelVersion) { this.patientResults = patientResults; this.modelVersion = modelVersion; } @@ -64,4 +62,46 @@ public List getPatientResults() { public String getModelVersion() { return this.modelVersion; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("patientResults", this.patientResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("modelVersion", this.modelVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsInferenceResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsInferenceResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiologyInsightsInferenceResult. + */ + @Generated + public static RadiologyInsightsInferenceResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List patientResults = null; + String modelVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("patientResults".equals(fieldName)) { + patientResults = reader.readArray(reader1 -> RadiologyInsightsPatientResult.fromJson(reader1)); + } else if ("modelVersion".equals(fieldName)) { + modelVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new RadiologyInsightsInferenceResult(patientResults, modelVersion); + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceType.java index 8e5dbd6f0c527..65821efc8e3f5 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsInferenceType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -92,7 +91,6 @@ public RadiologyInsightsInferenceType() { * @return the corresponding RadiologyInsightsInferenceType. */ @Generated - @JsonCreator public static RadiologyInsightsInferenceType fromString(String name) { return fromString(name, RadiologyInsightsInferenceType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsJob.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsJob.java new file mode 100644 index 0000000000000..a775891c69dc6 --- /dev/null +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsJob.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.health.insights.radiologyinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.models.ResponseError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Response for the Radiology Insights request. + */ +@Fluent +public final class RadiologyInsightsJob implements JsonSerializable { + /* + * The request data for the operation. + */ + @Generated + private RadiologyInsightsData jobData; + + /* + * The result of the operation. + */ + @Generated + private RadiologyInsightsInferenceResult result; + + /* + * The unique ID of the job. + */ + @Generated + private String id; + + /* + * The status of the job. + */ + @Generated + private JobStatus status; + + /* + * The date and time when the processing job was created. + */ + @Generated + private OffsetDateTime createdAt; + + /* + * The date and time when the processing job is set to expire. + */ + @Generated + private OffsetDateTime expiresAt; + + /* + * The date and time when the processing job was last updated. + */ + @Generated + private OffsetDateTime updatedAt; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /** + * Creates an instance of RadiologyInsightsJob class. + */ + @Generated + public RadiologyInsightsJob() { + } + + /** + * Get the jobData property: The request data for the operation. + * + * @return the jobData value. + */ + @Generated + public RadiologyInsightsData getJobData() { + return this.jobData; + } + + /** + * Set the jobData property: The request data for the operation. + * + * @param jobData the jobData value to set. + * @return the RadiologyInsightsJob object itself. + */ + @Generated + public RadiologyInsightsJob setJobData(RadiologyInsightsData jobData) { + this.jobData = jobData; + return this; + } + + /** + * Get the result property: The result of the operation. + * + * @return the result value. + */ + @Generated + public RadiologyInsightsInferenceResult getResult() { + return this.result; + } + + /** + * Get the id property: The unique ID of the job. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The status of the job. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the createdAt property: The date and time when the processing job was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return this.createdAt; + } + + /** + * Get the expiresAt property: The date and time when the processing job is set to expire. + * + * @return the expiresAt value. + */ + @Generated + public OffsetDateTime getExpiresAt() { + return this.expiresAt; + } + + /** + * Get the updatedAt property: The date and time when the processing job was last updated. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + return this.updatedAt; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("jobData", this.jobData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsJob if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiologyInsightsJob. + */ + @Generated + public static RadiologyInsightsJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RadiologyInsightsJob deserializedRadiologyInsightsJob = new RadiologyInsightsJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRadiologyInsightsJob.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedRadiologyInsightsJob.status = JobStatus.fromString(reader.getString()); + } else if ("jobData".equals(fieldName)) { + deserializedRadiologyInsightsJob.jobData = RadiologyInsightsData.fromJson(reader); + } else if ("result".equals(fieldName)) { + deserializedRadiologyInsightsJob.result = RadiologyInsightsInferenceResult.fromJson(reader); + } else if ("createdAt".equals(fieldName)) { + deserializedRadiologyInsightsJob.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiresAt".equals(fieldName)) { + deserializedRadiologyInsightsJob.expiresAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedAt".equals(fieldName)) { + deserializedRadiologyInsightsJob.updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedRadiologyInsightsJob.error = ResponseError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRadiologyInsightsJob; + }); + } +} diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsModelConfiguration.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsModelConfiguration.java index f5cb2c1001276..ec49e4cdee21d 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsModelConfiguration.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsModelConfiguration.java @@ -5,27 +5,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Configuration affecting the Radiology Insights model's inference. */ @Fluent -public final class RadiologyInsightsModelConfiguration { +public final class RadiologyInsightsModelConfiguration + implements JsonSerializable { /* * An indication whether the model should produce verbose output. */ @Generated - @JsonProperty(value = "verbose") private Boolean verbose; /* * An indication whether the model's output should include evidence for the inferences. */ @Generated - @JsonProperty(value = "includeEvidence") private Boolean includeEvidence; /* @@ -34,21 +37,18 @@ public final class RadiologyInsightsModelConfiguration { * inference types. */ @Generated - @JsonProperty(value = "inferenceTypes") private List inferenceTypes; /* * Options regarding follow up recommendation inferences and finding inferences. */ @Generated - @JsonProperty(value = "inferenceOptions") private RadiologyInsightsInferenceOptions inferenceOptions; /* * Local for the model to use. If not specified, the model will use the default locale. */ @Generated - @JsonProperty(value = "locale") private String locale; /** @@ -173,4 +173,59 @@ public RadiologyInsightsModelConfiguration setLocale(String locale) { this.locale = locale; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("verbose", this.verbose); + jsonWriter.writeBooleanField("includeEvidence", this.includeEvidence); + jsonWriter.writeArrayField("inferenceTypes", this.inferenceTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("inferenceOptions", this.inferenceOptions); + jsonWriter.writeStringField("locale", this.locale); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsModelConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsModelConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RadiologyInsightsModelConfiguration. + */ + @Generated + public static RadiologyInsightsModelConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RadiologyInsightsModelConfiguration deserializedRadiologyInsightsModelConfiguration + = new RadiologyInsightsModelConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("verbose".equals(fieldName)) { + deserializedRadiologyInsightsModelConfiguration.verbose + = reader.getNullable(JsonReader::getBoolean); + } else if ("includeEvidence".equals(fieldName)) { + deserializedRadiologyInsightsModelConfiguration.includeEvidence + = reader.getNullable(JsonReader::getBoolean); + } else if ("inferenceTypes".equals(fieldName)) { + List inferenceTypes + = reader.readArray(reader1 -> RadiologyInsightsInferenceType.fromString(reader1.getString())); + deserializedRadiologyInsightsModelConfiguration.inferenceTypes = inferenceTypes; + } else if ("inferenceOptions".equals(fieldName)) { + deserializedRadiologyInsightsModelConfiguration.inferenceOptions + = RadiologyInsightsInferenceOptions.fromJson(reader); + } else if ("locale".equals(fieldName)) { + deserializedRadiologyInsightsModelConfiguration.locale = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedRadiologyInsightsModelConfiguration; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsPatientResult.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsPatientResult.java index d5b20540bfa3b..9e717463f4cf5 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsPatientResult.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyInsightsPatientResult.java @@ -5,28 +5,29 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Results of the model's work for a single patient. */ @Immutable -public final class RadiologyInsightsPatientResult { +public final class RadiologyInsightsPatientResult implements JsonSerializable { /* * Identifier given for the patient in the request. */ @Generated - @JsonProperty(value = "patientId") private final String patientId; /* * The model's inferences for the given patient. */ @Generated - @JsonProperty(value = "inferences") private final List inferences; /** @@ -36,9 +37,7 @@ public final class RadiologyInsightsPatientResult { * @param inferences the inferences value to set. */ @Generated - @JsonCreator - private RadiologyInsightsPatientResult(@JsonProperty(value = "patientId") String patientId, - @JsonProperty(value = "inferences") List inferences) { + private RadiologyInsightsPatientResult(String patientId, List inferences) { this.patientId = patientId; this.inferences = inferences; } @@ -62,4 +61,45 @@ public String getPatientId() { public List getInferences() { return this.inferences; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patientId", this.patientId); + jsonWriter.writeArrayField("inferences", this.inferences, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyInsightsPatientResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyInsightsPatientResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiologyInsightsPatientResult. + */ + @Generated + public static RadiologyInsightsPatientResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String patientId = null; + List inferences = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("patientId".equals(fieldName)) { + patientId = reader.getString(); + } else if ("inferences".equals(fieldName)) { + inferences = reader.readArray(reader1 -> RadiologyInsightsInference.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new RadiologyInsightsPatientResult(patientId, inferences); + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyProcedureInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyProcedureInference.java index a90af1df002b9..dbf0ce6740a3e 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyProcedureInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RadiologyProcedureInference.java @@ -5,23 +5,16 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Radiology procedures are the specific imaging studies or examinations ordered for the patient, extracted from the * document information and text. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "kind", - defaultImpl = RadiologyProcedureInference.class, - visible = true) -@JsonTypeName("radiologyProcedure") @Immutable public final class RadiologyProcedureInference extends RadiologyInsightsInference { @@ -29,29 +22,24 @@ public final class RadiologyProcedureInference extends RadiologyInsightsInferenc * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE; /* * LOINC codes for the procedure. */ @Generated - @JsonProperty(value = "procedureCodes") private List procedureCodes; /* * Imaging procedures. */ @Generated - @JsonProperty(value = "imagingProcedures") private final List imagingProcedures; /* * Ordered procedure information from the document information or text. */ @Generated - @JsonProperty(value = "orderedProcedure") private final OrderedProcedure orderedProcedure; /** @@ -61,10 +49,7 @@ public final class RadiologyProcedureInference extends RadiologyInsightsInferenc * @param orderedProcedure the orderedProcedure value to set. */ @Generated - @JsonCreator - private RadiologyProcedureInference( - @JsonProperty(value = "imagingProcedures") List imagingProcedures, - @JsonProperty(value = "orderedProcedure") OrderedProcedure orderedProcedure) { + private RadiologyProcedureInference(List imagingProcedures, OrderedProcedure orderedProcedure) { this.imagingProcedures = imagingProcedures; this.orderedProcedure = orderedProcedure; } @@ -109,4 +94,81 @@ public List getImagingProcedures() { public OrderedProcedure getOrderedProcedure() { return this.orderedProcedure; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("imagingProcedures", this.imagingProcedures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("orderedProcedure", this.orderedProcedure); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("procedureCodes", this.procedureCodes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiologyProcedureInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiologyProcedureInference if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiologyProcedureInference. + */ + @Generated + public static RadiologyProcedureInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + List imagingProcedures = null; + OrderedProcedure orderedProcedure = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.RADIOLOGY_PROCEDURE; + List procedureCodes = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("imagingProcedures".equals(fieldName)) { + imagingProcedures = reader.readArray(reader1 -> ImagingProcedure.fromJson(reader1)); + } else if ("orderedProcedure".equals(fieldName)) { + orderedProcedure = OrderedProcedure.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else if ("procedureCodes".equals(fieldName)) { + procedureCodes = reader.readArray(reader1 -> FhirR4CodeableConcept.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + RadiologyProcedureInference deserializedRadiologyProcedureInference + = new RadiologyProcedureInference(imagingProcedures, orderedProcedure); + deserializedRadiologyProcedureInference.extension = extension; + deserializedRadiologyProcedureInference.kind = kind; + deserializedRadiologyProcedureInference.procedureCodes = procedureCodes; + return deserializedRadiologyProcedureInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFinding.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFinding.java index b7327555148b2..76ee7e6690a93 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFinding.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFinding.java @@ -5,42 +5,41 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Finding reference for recommendation. */ @Immutable -public final class RecommendationFinding { +public final class RecommendationFinding implements JsonSerializable { /* * Additional Content defined by implementations */ @Generated - @JsonProperty(value = "extension") private List extension; /* * Finding linked to a recommendation. */ @Generated - @JsonProperty(value = "finding") private FhirR4Observation finding; /* * Critical result linked to a recommendation. */ @Generated - @JsonProperty(value = "criticalFinding") private CriticalResult criticalFinding; /* * Recommendation finding status. */ @Generated - @JsonProperty(value = "recommendationFindingStatus") private final RecommendationFindingStatusType recommendationFindingStatus; /** @@ -49,9 +48,7 @@ public final class RecommendationFinding { * @param recommendationFindingStatus the recommendationFindingStatus value to set. */ @Generated - @JsonCreator - private RecommendationFinding(@JsonProperty( - value = "recommendationFindingStatus") RecommendationFindingStatusType recommendationFindingStatus) { + private RecommendationFinding(RecommendationFindingStatusType recommendationFindingStatus) { this.recommendationFindingStatus = recommendationFindingStatus; } @@ -94,4 +91,59 @@ public CriticalResult getCriticalFinding() { public RecommendationFindingStatusType getRecommendationFindingStatus() { return this.recommendationFindingStatus; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("recommendationFindingStatus", + this.recommendationFindingStatus == null ? null : this.recommendationFindingStatus.toString()); + jsonWriter.writeJsonField("finding", this.finding); + jsonWriter.writeJsonField("criticalFinding", this.criticalFinding); + jsonWriter.writeArrayField("extension", this.extension, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationFinding from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationFinding if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendationFinding. + */ + @Generated + public static RecommendationFinding fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationFindingStatusType recommendationFindingStatus = null; + FhirR4Observation finding = null; + CriticalResult criticalFinding = null; + List extension = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("recommendationFindingStatus".equals(fieldName)) { + recommendationFindingStatus = RecommendationFindingStatusType.fromString(reader.getString()); + } else if ("finding".equals(fieldName)) { + finding = FhirR4Observation.fromJson(reader); + } else if ("criticalFinding".equals(fieldName)) { + criticalFinding = CriticalResult.fromJson(reader); + } else if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + RecommendationFinding deserializedRecommendationFinding + = new RecommendationFinding(recommendationFindingStatus); + deserializedRecommendationFinding.finding = finding; + deserializedRecommendationFinding.criticalFinding = criticalFinding; + deserializedRecommendationFinding.extension = extension; + return deserializedRecommendationFinding; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFindingStatusType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFindingStatusType.java index dfdff0c5955e3..1ec7c9e58f382 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFindingStatusType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/RecommendationFindingStatusType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -54,7 +53,6 @@ public RecommendationFindingStatusType() { * @return the corresponding RecommendationFindingStatusType. */ @Generated - @JsonCreator public static RecommendationFindingStatusType fromString(String name) { return fromString(name, RecommendationFindingStatusType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyArm.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyArm.java index 2b63bc399cba1..44137380b3cfd 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyArm.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyArm.java @@ -5,34 +5,34 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The ResearchStudyArm model. */ @Immutable -public final class ResearchStudyArm { +public final class ResearchStudyArm implements JsonSerializable { /* * Label for study arm */ @Generated - @JsonProperty(value = "name") private final String name; /* * Categorization of study arm */ @Generated - @JsonProperty(value = "type") private FhirR4CodeableConcept type; /* * Short explanation of study path */ @Generated - @JsonProperty(value = "description") private String description; /** @@ -41,8 +41,7 @@ public final class ResearchStudyArm { * @param name the name value to set. */ @Generated - @JsonCreator - private ResearchStudyArm(@JsonProperty(value = "name") String name) { + private ResearchStudyArm(String name) { this.name = name; } @@ -75,4 +74,52 @@ public FhirR4CodeableConcept getType() { public String getDescription() { return this.description; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("type", this.type); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResearchStudyArm from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResearchStudyArm if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResearchStudyArm. + */ + @Generated + public static ResearchStudyArm fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + FhirR4CodeableConcept type = null; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("type".equals(fieldName)) { + type = FhirR4CodeableConcept.fromJson(reader); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + ResearchStudyArm deserializedResearchStudyArm = new ResearchStudyArm(name); + deserializedResearchStudyArm.type = type; + deserializedResearchStudyArm.description = description; + return deserializedResearchStudyArm; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyObjective.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyObjective.java index 9119f3d21cfdb..16b1a0f6bb67c 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyObjective.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyObjective.java @@ -5,27 +5,28 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The ResearchStudyObjective model. */ @Immutable -public final class ResearchStudyObjective { +public final class ResearchStudyObjective implements JsonSerializable { /* * Label for the objective */ @Generated - @JsonProperty(value = "name") private final String name; /* * primary | secondary | exploratory */ @Generated - @JsonProperty(value = "type") private FhirR4CodeableConcept type; /** @@ -34,8 +35,7 @@ public final class ResearchStudyObjective { * @param name the name value to set. */ @Generated - @JsonCreator - private ResearchStudyObjective(@JsonProperty(value = "name") String name) { + private ResearchStudyObjective(String name) { this.name = name; } @@ -58,4 +58,47 @@ public String getName() { public FhirR4CodeableConcept getType() { return this.type; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResearchStudyObjective from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResearchStudyObjective if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResearchStudyObjective. + */ + @Generated + public static ResearchStudyObjective fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + FhirR4CodeableConcept type = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("type".equals(fieldName)) { + type = FhirR4CodeableConcept.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ResearchStudyObjective deserializedResearchStudyObjective = new ResearchStudyObjective(name); + deserializedResearchStudyObjective.type = type; + return deserializedResearchStudyObjective; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyStatusCodeType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyStatusCodeType.java index d6de6f10ffeb3..0d2236dafcfb3 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyStatusCodeType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/ResearchStudyStatusCodeType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -103,7 +102,6 @@ public ResearchStudyStatusCodeType() { * @return the corresponding ResearchStudyStatusCodeType. */ @Generated - @JsonCreator public static ResearchStudyStatusCodeType fromString(String name) { return fromString(name, ResearchStudyStatusCodeType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SexMismatchInference.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SexMismatchInference.java index 56ae3b55dff03..4c1b87f8570fa 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SexMismatchInference.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SexMismatchInference.java @@ -5,19 +5,17 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeId; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; /** * A notification for a sex mismatch is displayed when the gender, personal pronouns, gender-related body parts, or * gender-related procedures mentioned in a patient's clinical document are either inconsistent or do not match the * gender specified in the patient information. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = SexMismatchInference.class, visible = true) -@JsonTypeName("sexMismatch") @Immutable public final class SexMismatchInference extends RadiologyInsightsInference { @@ -25,15 +23,12 @@ public final class SexMismatchInference extends RadiologyInsightsInference { * Discriminator property for RadiologyInsightsInference. */ @Generated - @JsonTypeId - @JsonProperty(value = "kind") private RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.SEX_MISMATCH; /* * Sex indication : SNOMED CT code for gender finding. */ @Generated - @JsonProperty(value = "sexIndication") private final FhirR4CodeableConcept sexIndication; /** @@ -42,8 +37,7 @@ public final class SexMismatchInference extends RadiologyInsightsInference { * @param sexIndication the sexIndication value to set. */ @Generated - @JsonCreator - private SexMismatchInference(@JsonProperty(value = "sexIndication") FhirR4CodeableConcept sexIndication) { + private SexMismatchInference(FhirR4CodeableConcept sexIndication) { this.sexIndication = sexIndication; } @@ -67,4 +61,69 @@ public RadiologyInsightsInferenceType getKind() { public FhirR4CodeableConcept getSexIndication() { return this.sexIndication; } + + /* + * Additional Content defined by implementations + */ + @Generated + private List extension; + + /** + * Get the extension property: Additional Content defined by implementations. + * + * @return the extension value. + */ + @Generated + @Override + public List getExtension() { + return this.extension; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("extension", getExtension(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sexIndication", this.sexIndication); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SexMismatchInference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SexMismatchInference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SexMismatchInference. + */ + @Generated + public static SexMismatchInference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List extension = null; + FhirR4CodeableConcept sexIndication = null; + RadiologyInsightsInferenceType kind = RadiologyInsightsInferenceType.SEX_MISMATCH; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("extension".equals(fieldName)) { + extension = reader.readArray(reader1 -> FhirR4Extension.fromJson(reader1)); + } else if ("sexIndication".equals(fieldName)) { + sexIndication = FhirR4CodeableConcept.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = RadiologyInsightsInferenceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + SexMismatchInference deserializedSexMismatchInference = new SexMismatchInference(sexIndication); + deserializedSexMismatchInference.extension = extension; + deserializedSexMismatchInference.kind = kind; + return deserializedSexMismatchInference; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SpecialtyType.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SpecialtyType.java index b21b46d62c164..30f48b2fe9694 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SpecialtyType.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/SpecialtyType.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public SpecialtyType() { * @return the corresponding SpecialtyType. */ @Generated - @JsonCreator public static SpecialtyType fromString(String name) { return fromString(name, SpecialtyType.class); } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/TimePeriod.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/TimePeriod.java index d768b1f66300d..2135d0e29ced7 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/TimePeriod.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/models/TimePeriod.java @@ -5,27 +5,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * A duration of time during which an event is happening. */ @Fluent -public final class TimePeriod { +public final class TimePeriod implements JsonSerializable { /* * Starting time with inclusive boundary */ @Generated - @JsonProperty(value = "start") private OffsetDateTime start; /* * End time with inclusive boundary, if not ongoing */ @Generated - @JsonProperty(value = "end") private OffsetDateTime end; /** @@ -78,4 +82,47 @@ public TimePeriod setEnd(OffsetDateTime end) { this.end = end; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("start", + this.start == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.start)); + jsonWriter.writeStringField("end", + this.end == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.end)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimePeriod from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimePeriod if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TimePeriod. + */ + @Generated + public static TimePeriod fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimePeriod deserializedTimePeriod = new TimePeriod(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("start".equals(fieldName)) { + deserializedTimePeriod.start = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("end".equals(fieldName)) { + deserializedTimePeriod.end = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return deserializedTimePeriod; + }); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/module-info.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/module-info.java index ad70b8fff0f4c..3d5972a42a1d3 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/module-info.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/module-info.java @@ -6,5 +6,6 @@ requires transitive com.azure.core; exports com.azure.health.insights.radiologyinsights; exports com.azure.health.insights.radiologyinsights.models; + opens com.azure.health.insights.radiologyinsights.models to com.azure.core; opens com.azure.health.insights.radiologyinsights.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/resources/META-INF/azure-health-insights-radiologyinsights_apiview_properties.json b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/resources/META-INF/azure-health-insights-radiologyinsights_apiview_properties.json index 5dc1ae409f06e..dac2409dc664f 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/resources/META-INF/azure-health-insights-radiologyinsights_apiview_properties.json +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/resources/META-INF/azure-health-insights-radiologyinsights_apiview_properties.json @@ -1,13 +1,13 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { - "com.azure.health.insights.radiologyinsights.RadiologyInsightsAsyncClient": "AzureHealthInsights.RadiologyInsightsClient", + "com.azure.health.insights.radiologyinsights.RadiologyInsightsAsyncClient": "ClientForAzureHealthInsights.RadiologyInsightsClient", "com.azure.health.insights.radiologyinsights.RadiologyInsightsAsyncClient.beginInferRadiologyInsights": "ClientForAzureHealthInsights.RadiologyInsightsClient.inferRadiologyInsights", "com.azure.health.insights.radiologyinsights.RadiologyInsightsAsyncClient.beginInferRadiologyInsightsWithModel": "ClientForAzureHealthInsights.RadiologyInsightsClient.inferRadiologyInsights", - "com.azure.health.insights.radiologyinsights.RadiologyInsightsClient": "AzureHealthInsights.RadiologyInsightsClient", + "com.azure.health.insights.radiologyinsights.RadiologyInsightsClient": "ClientForAzureHealthInsights.RadiologyInsightsClient", "com.azure.health.insights.radiologyinsights.RadiologyInsightsClient.beginInferRadiologyInsights": "ClientForAzureHealthInsights.RadiologyInsightsClient.inferRadiologyInsights", "com.azure.health.insights.radiologyinsights.RadiologyInsightsClient.beginInferRadiologyInsightsWithModel": "ClientForAzureHealthInsights.RadiologyInsightsClient.inferRadiologyInsights", - "com.azure.health.insights.radiologyinsights.RadiologyInsightsClientBuilder": "AzureHealthInsights.RadiologyInsightsClient", + "com.azure.health.insights.radiologyinsights.RadiologyInsightsClientBuilder": "ClientForAzureHealthInsights.RadiologyInsightsClient", "com.azure.health.insights.radiologyinsights.models.AgeMismatchInference": "AzureHealthInsights.AgeMismatchInference", "com.azure.health.insights.radiologyinsights.models.ClinicalDocumentType": "AzureHealthInsights.ClinicalDocumentType", "com.azure.health.insights.radiologyinsights.models.CompleteOrderDiscrepancyInference": "AzureHealthInsights.CompleteOrderDiscrepancyInference", @@ -20,7 +20,6 @@ "com.azure.health.insights.radiologyinsights.models.DocumentContent": "AzureHealthInsights.DocumentContent", "com.azure.health.insights.radiologyinsights.models.DocumentContentSourceType": "AzureHealthInsights.DocumentContentSourceType", "com.azure.health.insights.radiologyinsights.models.DocumentType": "AzureHealthInsights.DocumentType", - "com.azure.health.insights.radiologyinsights.models.Encounter": "AzureHealthInsights.Encounter", "com.azure.health.insights.radiologyinsights.models.EncounterClass": "AzureHealthInsights.EncounterClass", "com.azure.health.insights.radiologyinsights.models.FhirR4Annotation": "Fhir.R4.Annotation", "com.azure.health.insights.radiologyinsights.models.FhirR4CodeableConcept": "Fhir.R4.CodeableConcept", @@ -61,10 +60,11 @@ "com.azure.health.insights.radiologyinsights.models.MedicalProfessionalType": "AzureHealthInsights.MedicalProfessionalType", "com.azure.health.insights.radiologyinsights.models.ObservationStatusCodeType": "Fhir.R4.ObservationStatusCodeType", "com.azure.health.insights.radiologyinsights.models.OrderedProcedure": "AzureHealthInsights.OrderedProcedure", - "com.azure.health.insights.radiologyinsights.models.PatientDetails": "AzureHealthInsights.PatientInfo", + "com.azure.health.insights.radiologyinsights.models.PatientDetails": "AzureHealthInsights.PatientDetails", "com.azure.health.insights.radiologyinsights.models.PatientDocument": "AzureHealthInsights.PatientDocument", + "com.azure.health.insights.radiologyinsights.models.PatientEncounter": "AzureHealthInsights.PatientEncounter", "com.azure.health.insights.radiologyinsights.models.PatientRecord": "AzureHealthInsights.PatientRecord", - "com.azure.health.insights.radiologyinsights.models.PatientSex": "AzureHealthInsights.PatientInfoSex", + "com.azure.health.insights.radiologyinsights.models.PatientSex": "AzureHealthInsights.PatientSex", "com.azure.health.insights.radiologyinsights.models.ProcedureRecommendation": "AzureHealthInsights.ProcedureRecommendation", "com.azure.health.insights.radiologyinsights.models.RadiologyCodeWithTypes": "AzureHealthInsights.RadiologyCodeWithTypes", "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsData": "AzureHealthInsights.RadiologyInsightsData", @@ -72,14 +72,14 @@ "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsInferenceOptions": "AzureHealthInsights.RadiologyInsightsInferenceOptions", "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsInferenceResult": "AzureHealthInsights.RadiologyInsightsInferenceResult", "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsInferenceType": "AzureHealthInsights.RadiologyInsightsInferenceType", + "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsJob": "AzureHealthInsights.RadiologyInsightsJob", "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsModelConfiguration": "AzureHealthInsights.RadiologyInsightsModelConfiguration", "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsPatientResult": "AzureHealthInsights.RadiologyInsightsPatientResult", - "com.azure.health.insights.radiologyinsights.models.RadiologyInsightsResult": "AzureHealthInsights.RadiologyInsightsResult", "com.azure.health.insights.radiologyinsights.models.RadiologyProcedureInference": "AzureHealthInsights.RadiologyProcedureInference", "com.azure.health.insights.radiologyinsights.models.RecommendationFinding": "AzureHealthInsights.RecommendationFinding", "com.azure.health.insights.radiologyinsights.models.RecommendationFindingStatusType": "AzureHealthInsights.RecommendationFindingStatusType", - "com.azure.health.insights.radiologyinsights.models.ResearchStudyArm": "ResearchStudy.arm.anonymous", - "com.azure.health.insights.radiologyinsights.models.ResearchStudyObjective": "ResearchStudy.objective.anonymous", + "com.azure.health.insights.radiologyinsights.models.ResearchStudyArm": "Fhir.R4.ResearchStudy.arm.anonymous", + "com.azure.health.insights.radiologyinsights.models.ResearchStudyObjective": "Fhir.R4.ResearchStudy.objective.anonymous", "com.azure.health.insights.radiologyinsights.models.ResearchStudyStatusCodeType": "Fhir.R4.ResearchStudyStatusCodeType", "com.azure.health.insights.radiologyinsights.models.SexMismatchInference": "AzureHealthInsights.SexMismatchInference", "com.azure.health.insights.radiologyinsights.models.SpecialtyType": "AzureHealthInsights.SpecialtyType", diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/test/java/com/azure/health/insights/radiologyinsights/generated/RadiologyInsightsClientTestBase.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/test/java/com/azure/health/insights/radiologyinsights/generated/RadiologyInsightsClientTestBase.java new file mode 100644 index 0000000000000..6eeaff0774553 --- /dev/null +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/test/java/com/azure/health/insights/radiologyinsights/generated/RadiologyInsightsClientTestBase.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.health.insights.radiologyinsights.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.health.insights.radiologyinsights.RadiologyInsightsClient; +import com.azure.health.insights.radiologyinsights.RadiologyInsightsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +class RadiologyInsightsClientTestBase extends TestProxyTestBase { + protected RadiologyInsightsClient radiologyInsightsClient; + + @Override + protected void beforeTest() { + RadiologyInsightsClientBuilder radiologyInsightsClientbuilder = new RadiologyInsightsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + radiologyInsightsClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + radiologyInsightsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + radiologyInsightsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + radiologyInsightsClient = radiologyInsightsClientbuilder.buildClient(); + + } +} diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/tsp-location.yaml b/sdk/healthinsights/azure-health-insights-radiologyinsights/tsp-location.yaml index daf7bc797dfe6..056686899ce77 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/tsp-location.yaml +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/tsp-location.yaml @@ -1,7 +1,6 @@ directory: specification/ai/HealthInsights/HealthInsights.RadiologyInsights -additionalDirectories: - - specification/ai/HealthInsights/HealthInsights.Common - - specification/ai/HealthInsights/HealthInsights.OpenAPI -commit: 9b1d6b68cb4ab26724d6e813b7649a40902d622d +commit: 65171caa921a67914855465095f912fb17445d7e repo: Azure/azure-rest-api-specs -cleanup: false +additionalDirectories: +- specification/ai/HealthInsights/HealthInsights.Common +- specification/ai/HealthInsights/HealthInsights.OpenAPI