internal HealthcareEntityInternal(string text, HealthcareEntityCategory category, string subcategory, int offset, int length, double confidenceScore, HealthcareEntityAssertion assertion, string name, IList <EntityDataSource> links) { Text = text; Category = category; Subcategory = subcategory; Offset = offset; Length = length; ConfidenceScore = confidenceScore; Assertion = assertion; Name = name; Links = links; }
internal static HealthcareLinkingProperties DeserializeHealthcareLinkingProperties(JsonElement element) { Optional <HealthcareEntityAssertion> assertion = default; Optional <string> name = default; Optional <IReadOnlyList <EntityDataSource> > links = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("assertion")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } assertion = HealthcareEntityAssertion.DeserializeHealthcareEntityAssertion(property.Value); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("links")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <EntityDataSource> array = new List <EntityDataSource>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(EntityDataSource.DeserializeEntityDataSource(item)); } links = array; continue; } } return(new HealthcareLinkingProperties(assertion.Value, name.Value, Optional.ToList(links))); }
internal static HealthcareEntityInternal DeserializeHealthcareEntityInternal(JsonElement element) { Optional <HealthcareEntityAssertion> assertion = default; Optional <string> name = default; Optional <IReadOnlyList <EntityDataSource> > links = default; string text = default; string category = default; Optional <string> subcategory = default; int offset = default; int length = default; double confidenceScore = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("assertion")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } assertion = HealthcareEntityAssertion.DeserializeHealthcareEntityAssertion(property.Value); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("links")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <EntityDataSource> array = new List <EntityDataSource>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(EntityDataSource.DeserializeEntityDataSource(item)); } links = array; continue; } if (property.NameEquals("text")) { text = property.Value.GetString(); continue; } if (property.NameEquals("category")) { category = property.Value.GetString(); continue; } if (property.NameEquals("subcategory")) { subcategory = property.Value.GetString(); continue; } if (property.NameEquals("offset")) { offset = property.Value.GetInt32(); continue; } if (property.NameEquals("length")) { length = property.Value.GetInt32(); continue; } if (property.NameEquals("confidenceScore")) { confidenceScore = property.Value.GetDouble(); continue; } } return(new HealthcareEntityInternal(text, category, subcategory.Value, offset, length, confidenceScore, assertion.Value, name.Value, Optional.ToList(links))); }
internal HealthcareLinkingProperties(HealthcareEntityAssertion assertion, string name, IReadOnlyList <EntityDataSource> links) { Assertion = assertion; Name = name; Links = links; }
internal HealthcareEntityInternal(string text, string category, string subcategory, int offset, int length, double confidenceScore, HealthcareEntityAssertion assertion, string name, IReadOnlyList <EntityDataSource> links) : base(text, category, subcategory, offset, length, confidenceScore) { Assertion = assertion; Name = name; Links = links; }