Skip to main content

fhir_types/r4/
terminology_capabilities.rs

1// @generated by fhir-codegen from hl7.fhir.r4.core 4.0.1. DO NOT EDIT.
2// Change the emitter (tools/fhir-codegen) and regenerate.
3// SPDX-FileCopyrightText: Cadasto B.V.
4// SPDX-License-Identifier: Apache-2.0
5//! A statement of system capabilities
6
7/// A statement of system capabilities
8///
9/// A TerminologyCapabilities resource documents a set of capabilities
10/// (behaviors) of a FHIR Terminology Server that may be used as a statement of
11/// actual server functionality or a statement of required or desired server
12/// implementation.
13#[derive(Debug, Clone, Default, PartialEq, Eq)]
14pub struct TerminologyCapabilities {
15    /// Logical id of this artifact
16    ///
17    /// The logical id of the resource, as used in the URL for the resource. Once
18    /// assigned, this value never changes.
19    pub id: Option<std::string::String>,
20    /// Metadata about the resource
21    ///
22    /// The metadata about the resource. This is content that is maintained by the
23    /// infrastructure. Changes to the content might not always be associated with
24    /// version changes to the resource.
25    pub meta: Option<super::meta::Meta>,
26    /// A set of rules under which this content was created
27    ///
28    /// A reference to a set of rules that were followed when the resource was
29    /// constructed, and which must be understood when processing the content.
30    /// Often, this is a reference to an implementation guide that defines the
31    /// special rules along with other profiles etc.
32    pub implicit_rules: Option<super::primitives::Uri>,
33    /// Language of the resource content
34    ///
35    /// The base language in which the resource is written.
36    pub language: Option<super::primitives::Code>,
37    /// Text summary of the resource, for human interpretation
38    ///
39    /// A human-readable narrative that contains a summary of the resource and can
40    /// be used to represent the content of the resource to a human. The narrative
41    /// need not encode all the structured data, but is required to contain
42    /// sufficient detail to make it "clinically safe" for a human to just read the
43    /// narrative. Resource definitions may define what content should be
44    /// represented in the narrative to ensure clinical safety.
45    pub text: Option<super::narrative::Narrative>,
46    /// Contained, inline Resources
47    ///
48    /// These resources do not have an independent existence apart from the resource
49    /// that contains them - they cannot be identified independently, and nor can
50    /// they have their own independent transaction scope.
51    pub contained: Vec<super::resource::Resource>,
52    /// Additional content defined by implementations
53    ///
54    /// May be used to represent additional information that is not part of the
55    /// basic definition of the resource. To make the use of extensions safe and
56    /// manageable, there is a strict set of governance applied to the definition
57    /// and use of extensions. Though any implementer can define an extension, there
58    /// is a set of requirements that SHALL be met as part of the definition of the
59    /// extension.
60    pub extension: Vec<super::extension::Extension>,
61    /// Extensions that cannot be ignored
62    ///
63    /// May be used to represent additional information that is not part of the
64    /// basic definition of the resource and that modifies the understanding of the
65    /// element that contains it and/or the understanding of the containing
66    /// element's descendants. Usually modifier elements provide negation or
67    /// qualification. To make the use of extensions safe and manageable, there is a
68    /// strict set of governance applied to the definition and use of extensions.
69    /// Though any implementer is allowed to define an extension, there is a set of
70    /// requirements that SHALL be met as part of the definition of the extension.
71    /// Applications processing a resource are required to check for modifier
72    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
73    /// on Resource or DomainResource (including cannot change the meaning of
74    /// modifierExtension itself).
75    pub modifier_extension: Vec<super::extension::Extension>,
76    /// Canonical identifier for this terminology capabilities, represented as a URI
77    /// (globally unique)
78    ///
79    /// An absolute URI that is used to identify this terminology capabilities when
80    /// it is referenced in a specification, model, design or an instance; also
81    /// called its canonical identifier. This SHOULD be globally unique and SHOULD
82    /// be a literal address at which at which an authoritative instance of this
83    /// terminology capabilities is (or will be) published. This URL can be the
84    /// target of a canonical reference. It SHALL remain the same when the
85    /// terminology capabilities is stored on different servers.
86    pub url: Option<super::primitives::Uri>,
87    /// Business version of the terminology capabilities
88    ///
89    /// The identifier that is used to identify this version of the terminology
90    /// capabilities when it is referenced in a specification, model, design or
91    /// instance. This is an arbitrary value managed by the terminology capabilities
92    /// author and is not expected to be globally unique. For example, it might be a
93    /// timestamp (e.g. yyyymmdd) if a managed version is not available. There is
94    /// also no expectation that versions can be placed in a lexicographical
95    /// sequence.
96    pub version: Option<super::primitives::String>,
97    /// Name for this terminology capabilities (computer friendly)
98    ///
99    /// A natural language name identifying the terminology capabilities. This name
100    /// should be usable as an identifier for the module by machine processing
101    /// applications such as code generation.
102    pub name: Option<super::primitives::String>,
103    /// Name for this terminology capabilities (human friendly)
104    ///
105    /// A short, descriptive, user-friendly title for the terminology capabilities.
106    pub title: Option<super::primitives::String>,
107    /// draft | active | retired | unknown
108    ///
109    /// The status of this terminology capabilities. Enables tracking the life-cycle
110    /// of the content.
111    pub status: super::primitives::Code,
112    /// For testing purposes, not real usage
113    ///
114    /// A Boolean value to indicate that this terminology capabilities is authored
115    /// for testing purposes (or education/evaluation/marketing) and is not intended
116    /// to be used for genuine usage.
117    pub experimental: Option<super::primitives::Boolean>,
118    /// Date last changed
119    ///
120    /// The date (and optionally time) when the terminology capabilities was
121    /// published. The date must change when the business version changes and it
122    /// must change if the status code changes. In addition, it should change when
123    /// the substantive content of the terminology capabilities changes.
124    pub date: super::primitives::DateTime,
125    /// Name of the publisher (organization or individual)
126    ///
127    /// The name of the organization or individual that published the terminology
128    /// capabilities.
129    pub publisher: Option<super::primitives::String>,
130    /// Contact details for the publisher
131    ///
132    /// Contact details to assist a user in finding and communicating with the
133    /// publisher.
134    pub contact: Vec<super::contact_detail::ContactDetail>,
135    /// Natural language description of the terminology capabilities
136    ///
137    /// A free text natural language description of the terminology capabilities
138    /// from a consumer's perspective. Typically, this is used when the capability
139    /// statement describes a desired rather than an actual solution, for example as
140    /// a formal expression of requirements as part of an RFP.
141    pub description: Option<super::primitives::Markdown>,
142    /// The context that the content is intended to support
143    ///
144    /// The content was developed with a focus and intent of supporting the contexts
145    /// that are listed. These contexts may be general categories (gender, age, ...)
146    /// or may be references to specific programs (insurance plans, studies, ...)
147    /// and may be used to assist with indexing and searching for appropriate
148    /// terminology capabilities instances.
149    pub use_context: Vec<super::usage_context::UsageContext>,
150    /// Intended jurisdiction for terminology capabilities (if applicable)
151    ///
152    /// A legal or geographic region in which the terminology capabilities is
153    /// intended to be used.
154    pub jurisdiction: Vec<super::codeable_concept::CodeableConcept>,
155    /// Why this terminology capabilities is defined
156    ///
157    /// Explanation of why this terminology capabilities is needed and why it has
158    /// been designed as it has.
159    pub purpose: Option<super::primitives::Markdown>,
160    /// Use and/or publishing restrictions
161    ///
162    /// A copyright statement relating to the terminology capabilities and/or its
163    /// contents. Copyright statements are generally legal restrictions on the use
164    /// and publishing of the terminology capabilities.
165    pub copyright: Option<super::primitives::Markdown>,
166    /// instance | capability | requirements
167    ///
168    /// The way that this statement is intended to be used, to describe an actual
169    /// running instance of software, a particular product (kind, not instance of
170    /// software) or a class of implementation (e.g. a desired purchase).
171    pub kind: super::primitives::Code,
172    /// Software that is covered by this terminology capability statement
173    ///
174    /// Software that is covered by this terminology capability statement. It is
175    /// used when the statement describes the capabilities of a particular software
176    /// version, independent of an installation.
177    pub software: Option<TerminologyCapabilitiesSoftware>,
178    /// If this describes a specific instance
179    ///
180    /// Identifies a specific implementation instance that is described by the
181    /// terminology capability statement - i.e. a particular installation, rather
182    /// than the capabilities of a software program.
183    pub implementation: Option<TerminologyCapabilitiesImplementation>,
184    /// Whether lockedDate is supported
185    ///
186    /// Whether the server supports lockedDate.
187    pub locked_date: Option<super::primitives::Boolean>,
188    /// A code system supported by the server
189    ///
190    /// Identifies a code system that is supported by the server. If there is a no
191    /// code system URL, then this declares the general assumptions a client can
192    /// make about support for any CodeSystem resource.
193    pub code_system: Vec<TerminologyCapabilitiesCodeSystem>,
194    /// Information about the \[ValueSet/$expand\](valueset-operation-expand.html)
195    /// operation.
196    pub expansion: Option<TerminologyCapabilitiesExpansion>,
197    /// explicit | all
198    ///
199    /// The degree to which the server supports the code search parameter on
200    /// ValueSet, if it is supported.
201    pub code_search: Option<super::primitives::Code>,
202    /// Information about the
203    /// \[ValueSet/$validate-code\](valueset-operation-validate-code.html)
204    /// operation.
205    pub validate_code: Option<TerminologyCapabilitiesValidateCode>,
206    /// Information about the
207    /// \[ConceptMap/$translate\](conceptmap-operation-translate.html) operation.
208    pub translation: Option<TerminologyCapabilitiesTranslation>,
209    /// Information about the
210    /// \[ConceptMap/$closure\](conceptmap-operation-closure.html) operation
211    ///
212    /// Whether the $closure operation is supported.
213    pub closure: Option<TerminologyCapabilitiesClosure>,
214}
215
216impl super::super::codec::Json for TerminologyCapabilities {
217    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
218        let mut object = super::super::codec::Object::new();
219        object.insert(
220            std::string::String::from("resourceType"),
221            super::super::codec::Value::String(std::string::String::from(
222                "TerminologyCapabilities",
223            )),
224        );
225        if let Some(v) = &self.id {
226            object.insert(
227                std::string::String::from("id"),
228                super::super::codec::Value::String(v.clone()),
229            );
230        }
231        if let Some(item) = &self.meta {
232            object.insert(
233                std::string::String::from("meta"),
234                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
235            );
236        }
237        if let Some(item) = &self.implicit_rules {
238            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
239                object.insert(std::string::String::from("implicitRules"), v);
240            }
241            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
242                object.insert(std::string::String::from("_implicitRules"), e);
243            }
244        }
245        if let Some(item) = &self.language {
246            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
247                object.insert(std::string::String::from("language"), v);
248            }
249            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
250                object.insert(std::string::String::from("_language"), e);
251            }
252        }
253        if let Some(item) = &self.text {
254            object.insert(
255                std::string::String::from("text"),
256                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
257            );
258        }
259        if !self.contained.is_empty() {
260            let mut items = Vec::with_capacity(self.contained.len());
261            for item in &self.contained {
262                items.push(super::super::codec::Value::Object(
263                    super::super::codec::Json::to_json(item)?,
264                ));
265            }
266            object.insert(
267                std::string::String::from("contained"),
268                super::super::codec::Value::Array(items),
269            );
270        }
271        if !self.extension.is_empty() {
272            let mut items = Vec::with_capacity(self.extension.len());
273            for item in &self.extension {
274                items.push(super::super::codec::Value::Object(
275                    super::super::codec::Json::to_json(item)?,
276                ));
277            }
278            object.insert(
279                std::string::String::from("extension"),
280                super::super::codec::Value::Array(items),
281            );
282        }
283        if !self.modifier_extension.is_empty() {
284            let mut items = Vec::with_capacity(self.modifier_extension.len());
285            for item in &self.modifier_extension {
286                items.push(super::super::codec::Value::Object(
287                    super::super::codec::Json::to_json(item)?,
288                ));
289            }
290            object.insert(
291                std::string::String::from("modifierExtension"),
292                super::super::codec::Value::Array(items),
293            );
294        }
295        if let Some(item) = &self.url {
296            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
297                object.insert(std::string::String::from("url"), v);
298            }
299            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
300                object.insert(std::string::String::from("_url"), e);
301            }
302        }
303        if let Some(item) = &self.version {
304            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
305                object.insert(std::string::String::from("version"), v);
306            }
307            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
308                object.insert(std::string::String::from("_version"), e);
309            }
310        }
311        if let Some(item) = &self.name {
312            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
313                object.insert(std::string::String::from("name"), v);
314            }
315            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
316                object.insert(std::string::String::from("_name"), e);
317            }
318        }
319        if let Some(item) = &self.title {
320            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
321                object.insert(std::string::String::from("title"), v);
322            }
323            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
324                object.insert(std::string::String::from("_title"), e);
325            }
326        }
327        if let Some(v) = super::super::codec::Primitive::value_json(&self.status)? {
328            object.insert(std::string::String::from("status"), v);
329        }
330        if let Some(e) = super::super::codec::Primitive::element_json(&self.status)? {
331            object.insert(std::string::String::from("_status"), e);
332        }
333        if let Some(item) = &self.experimental {
334            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
335                object.insert(std::string::String::from("experimental"), v);
336            }
337            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
338                object.insert(std::string::String::from("_experimental"), e);
339            }
340        }
341        if let Some(v) = super::super::codec::Primitive::value_json(&self.date)? {
342            object.insert(std::string::String::from("date"), v);
343        }
344        if let Some(e) = super::super::codec::Primitive::element_json(&self.date)? {
345            object.insert(std::string::String::from("_date"), e);
346        }
347        if let Some(item) = &self.publisher {
348            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
349                object.insert(std::string::String::from("publisher"), v);
350            }
351            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
352                object.insert(std::string::String::from("_publisher"), e);
353            }
354        }
355        if !self.contact.is_empty() {
356            let mut items = Vec::with_capacity(self.contact.len());
357            for item in &self.contact {
358                items.push(super::super::codec::Value::Object(
359                    super::super::codec::Json::to_json(item)?,
360                ));
361            }
362            object.insert(
363                std::string::String::from("contact"),
364                super::super::codec::Value::Array(items),
365            );
366        }
367        if let Some(item) = &self.description {
368            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
369                object.insert(std::string::String::from("description"), v);
370            }
371            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
372                object.insert(std::string::String::from("_description"), e);
373            }
374        }
375        if !self.use_context.is_empty() {
376            let mut items = Vec::with_capacity(self.use_context.len());
377            for item in &self.use_context {
378                items.push(super::super::codec::Value::Object(
379                    super::super::codec::Json::to_json(item)?,
380                ));
381            }
382            object.insert(
383                std::string::String::from("useContext"),
384                super::super::codec::Value::Array(items),
385            );
386        }
387        if !self.jurisdiction.is_empty() {
388            let mut items = Vec::with_capacity(self.jurisdiction.len());
389            for item in &self.jurisdiction {
390                items.push(super::super::codec::Value::Object(
391                    super::super::codec::Json::to_json(item)?,
392                ));
393            }
394            object.insert(
395                std::string::String::from("jurisdiction"),
396                super::super::codec::Value::Array(items),
397            );
398        }
399        if let Some(item) = &self.purpose {
400            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
401                object.insert(std::string::String::from("purpose"), v);
402            }
403            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
404                object.insert(std::string::String::from("_purpose"), e);
405            }
406        }
407        if let Some(item) = &self.copyright {
408            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
409                object.insert(std::string::String::from("copyright"), v);
410            }
411            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
412                object.insert(std::string::String::from("_copyright"), e);
413            }
414        }
415        if let Some(v) = super::super::codec::Primitive::value_json(&self.kind)? {
416            object.insert(std::string::String::from("kind"), v);
417        }
418        if let Some(e) = super::super::codec::Primitive::element_json(&self.kind)? {
419            object.insert(std::string::String::from("_kind"), e);
420        }
421        if let Some(item) = &self.software {
422            object.insert(
423                std::string::String::from("software"),
424                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
425            );
426        }
427        if let Some(item) = &self.implementation {
428            object.insert(
429                std::string::String::from("implementation"),
430                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
431            );
432        }
433        if let Some(item) = &self.locked_date {
434            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
435                object.insert(std::string::String::from("lockedDate"), v);
436            }
437            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
438                object.insert(std::string::String::from("_lockedDate"), e);
439            }
440        }
441        if !self.code_system.is_empty() {
442            let mut items = Vec::with_capacity(self.code_system.len());
443            for item in &self.code_system {
444                items.push(super::super::codec::Value::Object(
445                    super::super::codec::Json::to_json(item)?,
446                ));
447            }
448            object.insert(
449                std::string::String::from("codeSystem"),
450                super::super::codec::Value::Array(items),
451            );
452        }
453        if let Some(item) = &self.expansion {
454            object.insert(
455                std::string::String::from("expansion"),
456                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
457            );
458        }
459        if let Some(item) = &self.code_search {
460            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
461                object.insert(std::string::String::from("codeSearch"), v);
462            }
463            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
464                object.insert(std::string::String::from("_codeSearch"), e);
465            }
466        }
467        if let Some(item) = &self.validate_code {
468            object.insert(
469                std::string::String::from("validateCode"),
470                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
471            );
472        }
473        if let Some(item) = &self.translation {
474            object.insert(
475                std::string::String::from("translation"),
476                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
477            );
478        }
479        if let Some(item) = &self.closure {
480            object.insert(
481                std::string::String::from("closure"),
482                super::super::codec::Value::Object(super::super::codec::Json::to_json(item)?),
483            );
484        }
485        Ok(object)
486    }
487
488    fn from_json(
489        object: &super::super::codec::Object,
490        path: &mut super::super::codec::Path,
491    ) -> Result<Self, super::super::codec::DecodeError> {
492        let mut raw_id: Option<&super::super::codec::Value> = None;
493        let mut raw_meta: Option<&super::super::codec::Value> = None;
494        let mut raw_implicit_rules: Option<&super::super::codec::Value> = None;
495        let mut raw_implicit_rules_element: Option<&super::super::codec::Value> = None;
496        let mut raw_language: Option<&super::super::codec::Value> = None;
497        let mut raw_language_element: Option<&super::super::codec::Value> = None;
498        let mut raw_text: Option<&super::super::codec::Value> = None;
499        let mut raw_contained: Option<&super::super::codec::Value> = None;
500        let mut raw_extension: Option<&super::super::codec::Value> = None;
501        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
502        let mut raw_url: Option<&super::super::codec::Value> = None;
503        let mut raw_url_element: Option<&super::super::codec::Value> = None;
504        let mut raw_version: Option<&super::super::codec::Value> = None;
505        let mut raw_version_element: Option<&super::super::codec::Value> = None;
506        let mut raw_name: Option<&super::super::codec::Value> = None;
507        let mut raw_name_element: Option<&super::super::codec::Value> = None;
508        let mut raw_title: Option<&super::super::codec::Value> = None;
509        let mut raw_title_element: Option<&super::super::codec::Value> = None;
510        let mut raw_status: Option<&super::super::codec::Value> = None;
511        let mut raw_status_element: Option<&super::super::codec::Value> = None;
512        let mut raw_experimental: Option<&super::super::codec::Value> = None;
513        let mut raw_experimental_element: Option<&super::super::codec::Value> = None;
514        let mut raw_date: Option<&super::super::codec::Value> = None;
515        let mut raw_date_element: Option<&super::super::codec::Value> = None;
516        let mut raw_publisher: Option<&super::super::codec::Value> = None;
517        let mut raw_publisher_element: Option<&super::super::codec::Value> = None;
518        let mut raw_contact: Option<&super::super::codec::Value> = None;
519        let mut raw_description: Option<&super::super::codec::Value> = None;
520        let mut raw_description_element: Option<&super::super::codec::Value> = None;
521        let mut raw_use_context: Option<&super::super::codec::Value> = None;
522        let mut raw_jurisdiction: Option<&super::super::codec::Value> = None;
523        let mut raw_purpose: Option<&super::super::codec::Value> = None;
524        let mut raw_purpose_element: Option<&super::super::codec::Value> = None;
525        let mut raw_copyright: Option<&super::super::codec::Value> = None;
526        let mut raw_copyright_element: Option<&super::super::codec::Value> = None;
527        let mut raw_kind: Option<&super::super::codec::Value> = None;
528        let mut raw_kind_element: Option<&super::super::codec::Value> = None;
529        let mut raw_software: Option<&super::super::codec::Value> = None;
530        let mut raw_implementation: Option<&super::super::codec::Value> = None;
531        let mut raw_locked_date: Option<&super::super::codec::Value> = None;
532        let mut raw_locked_date_element: Option<&super::super::codec::Value> = None;
533        let mut raw_code_system: Option<&super::super::codec::Value> = None;
534        let mut raw_expansion: Option<&super::super::codec::Value> = None;
535        let mut raw_code_search: Option<&super::super::codec::Value> = None;
536        let mut raw_code_search_element: Option<&super::super::codec::Value> = None;
537        let mut raw_validate_code: Option<&super::super::codec::Value> = None;
538        let mut raw_translation: Option<&super::super::codec::Value> = None;
539        let mut raw_closure: Option<&super::super::codec::Value> = None;
540        for (key, value) in object {
541            match key.as_str() {
542                "resourceType" => {
543                    if value.as_str() != Some("TerminologyCapabilities") {
544                        return Err(path.error(super::super::codec::DecodeErrorKind::ResourceType));
545                    }
546                }
547                "id" => {
548                    raw_id = Some(value);
549                }
550                "meta" => {
551                    raw_meta = Some(value);
552                }
553                "implicitRules" => {
554                    raw_implicit_rules = Some(value);
555                }
556                "_implicitRules" => {
557                    raw_implicit_rules_element = Some(value);
558                }
559                "language" => {
560                    raw_language = Some(value);
561                }
562                "_language" => {
563                    raw_language_element = Some(value);
564                }
565                "text" => {
566                    raw_text = Some(value);
567                }
568                "contained" => {
569                    raw_contained = Some(value);
570                }
571                "extension" => {
572                    raw_extension = Some(value);
573                }
574                "modifierExtension" => {
575                    raw_modifier_extension = Some(value);
576                }
577                "url" => {
578                    raw_url = Some(value);
579                }
580                "_url" => {
581                    raw_url_element = Some(value);
582                }
583                "version" => {
584                    raw_version = Some(value);
585                }
586                "_version" => {
587                    raw_version_element = Some(value);
588                }
589                "name" => {
590                    raw_name = Some(value);
591                }
592                "_name" => {
593                    raw_name_element = Some(value);
594                }
595                "title" => {
596                    raw_title = Some(value);
597                }
598                "_title" => {
599                    raw_title_element = Some(value);
600                }
601                "status" => {
602                    raw_status = Some(value);
603                }
604                "_status" => {
605                    raw_status_element = Some(value);
606                }
607                "experimental" => {
608                    raw_experimental = Some(value);
609                }
610                "_experimental" => {
611                    raw_experimental_element = Some(value);
612                }
613                "date" => {
614                    raw_date = Some(value);
615                }
616                "_date" => {
617                    raw_date_element = Some(value);
618                }
619                "publisher" => {
620                    raw_publisher = Some(value);
621                }
622                "_publisher" => {
623                    raw_publisher_element = Some(value);
624                }
625                "contact" => {
626                    raw_contact = Some(value);
627                }
628                "description" => {
629                    raw_description = Some(value);
630                }
631                "_description" => {
632                    raw_description_element = Some(value);
633                }
634                "useContext" => {
635                    raw_use_context = Some(value);
636                }
637                "jurisdiction" => {
638                    raw_jurisdiction = Some(value);
639                }
640                "purpose" => {
641                    raw_purpose = Some(value);
642                }
643                "_purpose" => {
644                    raw_purpose_element = Some(value);
645                }
646                "copyright" => {
647                    raw_copyright = Some(value);
648                }
649                "_copyright" => {
650                    raw_copyright_element = Some(value);
651                }
652                "kind" => {
653                    raw_kind = Some(value);
654                }
655                "_kind" => {
656                    raw_kind_element = Some(value);
657                }
658                "software" => {
659                    raw_software = Some(value);
660                }
661                "implementation" => {
662                    raw_implementation = Some(value);
663                }
664                "lockedDate" => {
665                    raw_locked_date = Some(value);
666                }
667                "_lockedDate" => {
668                    raw_locked_date_element = Some(value);
669                }
670                "codeSystem" => {
671                    raw_code_system = Some(value);
672                }
673                "expansion" => {
674                    raw_expansion = Some(value);
675                }
676                "codeSearch" => {
677                    raw_code_search = Some(value);
678                }
679                "_codeSearch" => {
680                    raw_code_search_element = Some(value);
681                }
682                "validateCode" => {
683                    raw_validate_code = Some(value);
684                }
685                "translation" => {
686                    raw_translation = Some(value);
687                }
688                "closure" => {
689                    raw_closure = Some(value);
690                }
691                other => {
692                    return path.with(other, |path| {
693                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
694                    });
695                }
696            }
697        }
698        let field_id = raw_id
699            .map(|value| {
700                path.with("id", |path| {
701                    let value = super::super::codec::expect_single(value, path)?;
702                    super::primitives::checked_id(
703                        super::super::codec::expect_string(value, path)?,
704                        path,
705                    )
706                })
707            })
708            .transpose()?;
709        let field_meta = raw_meta
710            .map(|value| {
711                path.with("meta", |path| {
712                    super::super::codec::Json::from_json(
713                        super::super::codec::expect_object(
714                            super::super::codec::expect_single(value, path)?,
715                            path,
716                        )?,
717                        path,
718                    )
719                })
720            })
721            .transpose()?;
722        let field_implicit_rules = match (raw_implicit_rules, raw_implicit_rules_element) {
723            (None, None) => None,
724            (value, element) => Some(path.with("implicitRules", |path| {
725                super::super::codec::Primitive::from_json_parts(value, element, path)
726            })?),
727        };
728        let field_language = match (raw_language, raw_language_element) {
729            (None, None) => None,
730            (value, element) => Some(path.with("language", |path| {
731                super::super::codec::Primitive::from_json_parts(value, element, path)
732            })?),
733        };
734        let field_text = raw_text
735            .map(|value| {
736                path.with("text", |path| {
737                    super::super::codec::Json::from_json(
738                        super::super::codec::expect_object(
739                            super::super::codec::expect_single(value, path)?,
740                            path,
741                        )?,
742                        path,
743                    )
744                })
745            })
746            .transpose()?;
747        let mut field_contained = Vec::new();
748        if let Some(raw) = raw_contained {
749            for (index, value) in path
750                .with("contained", |path| {
751                    super::super::codec::expect_array(raw, path)
752                })?
753                .iter()
754                .enumerate()
755            {
756                field_contained.push(path.with_index("contained", index, |path| {
757                    super::super::codec::Json::from_json(
758                        super::super::codec::expect_object(value, path)?,
759                        path,
760                    )
761                })?);
762            }
763        }
764        let mut field_extension = Vec::new();
765        if let Some(raw) = raw_extension {
766            for (index, value) in path
767                .with("extension", |path| {
768                    super::super::codec::expect_array(raw, path)
769                })?
770                .iter()
771                .enumerate()
772            {
773                field_extension.push(path.with_index("extension", index, |path| {
774                    super::super::codec::Json::from_json(
775                        super::super::codec::expect_object(value, path)?,
776                        path,
777                    )
778                })?);
779            }
780        }
781        let mut field_modifier_extension = Vec::new();
782        if let Some(raw) = raw_modifier_extension {
783            for (index, value) in path
784                .with("modifierExtension", |path| {
785                    super::super::codec::expect_array(raw, path)
786                })?
787                .iter()
788                .enumerate()
789            {
790                field_modifier_extension.push(path.with_index(
791                    "modifierExtension",
792                    index,
793                    |path| {
794                        super::super::codec::Json::from_json(
795                            super::super::codec::expect_object(value, path)?,
796                            path,
797                        )
798                    },
799                )?);
800            }
801        }
802        let field_url = match (raw_url, raw_url_element) {
803            (None, None) => None,
804            (value, element) => Some(path.with("url", |path| {
805                super::super::codec::Primitive::from_json_parts(value, element, path)
806            })?),
807        };
808        let field_version = match (raw_version, raw_version_element) {
809            (None, None) => None,
810            (value, element) => Some(path.with("version", |path| {
811                super::super::codec::Primitive::from_json_parts(value, element, path)
812            })?),
813        };
814        let field_name = match (raw_name, raw_name_element) {
815            (None, None) => None,
816            (value, element) => Some(path.with("name", |path| {
817                super::super::codec::Primitive::from_json_parts(value, element, path)
818            })?),
819        };
820        let field_title = match (raw_title, raw_title_element) {
821            (None, None) => None,
822            (value, element) => Some(path.with("title", |path| {
823                super::super::codec::Primitive::from_json_parts(value, element, path)
824            })?),
825        };
826        let field_status = path.with("status", |path| {
827            super::super::codec::Primitive::from_json_parts(raw_status, raw_status_element, path)
828        })?;
829        let field_experimental = match (raw_experimental, raw_experimental_element) {
830            (None, None) => None,
831            (value, element) => Some(path.with("experimental", |path| {
832                super::super::codec::Primitive::from_json_parts(value, element, path)
833            })?),
834        };
835        let field_date = path.with("date", |path| {
836            super::super::codec::Primitive::from_json_parts(raw_date, raw_date_element, path)
837        })?;
838        let field_publisher = match (raw_publisher, raw_publisher_element) {
839            (None, None) => None,
840            (value, element) => Some(path.with("publisher", |path| {
841                super::super::codec::Primitive::from_json_parts(value, element, path)
842            })?),
843        };
844        let mut field_contact = Vec::new();
845        if let Some(raw) = raw_contact {
846            for (index, value) in path
847                .with("contact", |path| {
848                    super::super::codec::expect_array(raw, path)
849                })?
850                .iter()
851                .enumerate()
852            {
853                field_contact.push(path.with_index("contact", index, |path| {
854                    super::super::codec::Json::from_json(
855                        super::super::codec::expect_object(value, path)?,
856                        path,
857                    )
858                })?);
859            }
860        }
861        let field_description = match (raw_description, raw_description_element) {
862            (None, None) => None,
863            (value, element) => Some(path.with("description", |path| {
864                super::super::codec::Primitive::from_json_parts(value, element, path)
865            })?),
866        };
867        let mut field_use_context = Vec::new();
868        if let Some(raw) = raw_use_context {
869            for (index, value) in path
870                .with("useContext", |path| {
871                    super::super::codec::expect_array(raw, path)
872                })?
873                .iter()
874                .enumerate()
875            {
876                field_use_context.push(path.with_index("useContext", index, |path| {
877                    super::super::codec::Json::from_json(
878                        super::super::codec::expect_object(value, path)?,
879                        path,
880                    )
881                })?);
882            }
883        }
884        let mut field_jurisdiction = Vec::new();
885        if let Some(raw) = raw_jurisdiction {
886            for (index, value) in path
887                .with("jurisdiction", |path| {
888                    super::super::codec::expect_array(raw, path)
889                })?
890                .iter()
891                .enumerate()
892            {
893                field_jurisdiction.push(path.with_index("jurisdiction", index, |path| {
894                    super::super::codec::Json::from_json(
895                        super::super::codec::expect_object(value, path)?,
896                        path,
897                    )
898                })?);
899            }
900        }
901        let field_purpose = match (raw_purpose, raw_purpose_element) {
902            (None, None) => None,
903            (value, element) => Some(path.with("purpose", |path| {
904                super::super::codec::Primitive::from_json_parts(value, element, path)
905            })?),
906        };
907        let field_copyright = match (raw_copyright, raw_copyright_element) {
908            (None, None) => None,
909            (value, element) => Some(path.with("copyright", |path| {
910                super::super::codec::Primitive::from_json_parts(value, element, path)
911            })?),
912        };
913        let field_kind = path.with("kind", |path| {
914            super::super::codec::Primitive::from_json_parts(raw_kind, raw_kind_element, path)
915        })?;
916        let field_software = raw_software
917            .map(|value| {
918                path.with("software", |path| {
919                    super::super::codec::Json::from_json(
920                        super::super::codec::expect_object(
921                            super::super::codec::expect_single(value, path)?,
922                            path,
923                        )?,
924                        path,
925                    )
926                })
927            })
928            .transpose()?;
929        let field_implementation = raw_implementation
930            .map(|value| {
931                path.with("implementation", |path| {
932                    super::super::codec::Json::from_json(
933                        super::super::codec::expect_object(
934                            super::super::codec::expect_single(value, path)?,
935                            path,
936                        )?,
937                        path,
938                    )
939                })
940            })
941            .transpose()?;
942        let field_locked_date = match (raw_locked_date, raw_locked_date_element) {
943            (None, None) => None,
944            (value, element) => Some(path.with("lockedDate", |path| {
945                super::super::codec::Primitive::from_json_parts(value, element, path)
946            })?),
947        };
948        let mut field_code_system = Vec::new();
949        if let Some(raw) = raw_code_system {
950            for (index, value) in path
951                .with("codeSystem", |path| {
952                    super::super::codec::expect_array(raw, path)
953                })?
954                .iter()
955                .enumerate()
956            {
957                field_code_system.push(path.with_index("codeSystem", index, |path| {
958                    super::super::codec::Json::from_json(
959                        super::super::codec::expect_object(value, path)?,
960                        path,
961                    )
962                })?);
963            }
964        }
965        let field_expansion = raw_expansion
966            .map(|value| {
967                path.with("expansion", |path| {
968                    super::super::codec::Json::from_json(
969                        super::super::codec::expect_object(
970                            super::super::codec::expect_single(value, path)?,
971                            path,
972                        )?,
973                        path,
974                    )
975                })
976            })
977            .transpose()?;
978        let field_code_search = match (raw_code_search, raw_code_search_element) {
979            (None, None) => None,
980            (value, element) => Some(path.with("codeSearch", |path| {
981                super::super::codec::Primitive::from_json_parts(value, element, path)
982            })?),
983        };
984        let field_validate_code = raw_validate_code
985            .map(|value| {
986                path.with("validateCode", |path| {
987                    super::super::codec::Json::from_json(
988                        super::super::codec::expect_object(
989                            super::super::codec::expect_single(value, path)?,
990                            path,
991                        )?,
992                        path,
993                    )
994                })
995            })
996            .transpose()?;
997        let field_translation = raw_translation
998            .map(|value| {
999                path.with("translation", |path| {
1000                    super::super::codec::Json::from_json(
1001                        super::super::codec::expect_object(
1002                            super::super::codec::expect_single(value, path)?,
1003                            path,
1004                        )?,
1005                        path,
1006                    )
1007                })
1008            })
1009            .transpose()?;
1010        let field_closure = raw_closure
1011            .map(|value| {
1012                path.with("closure", |path| {
1013                    super::super::codec::Json::from_json(
1014                        super::super::codec::expect_object(
1015                            super::super::codec::expect_single(value, path)?,
1016                            path,
1017                        )?,
1018                        path,
1019                    )
1020                })
1021            })
1022            .transpose()?;
1023        Ok(Self {
1024            id: field_id,
1025            meta: field_meta,
1026            implicit_rules: field_implicit_rules,
1027            language: field_language,
1028            text: field_text,
1029            contained: field_contained,
1030            extension: field_extension,
1031            modifier_extension: field_modifier_extension,
1032            url: field_url,
1033            version: field_version,
1034            name: field_name,
1035            title: field_title,
1036            status: field_status,
1037            experimental: field_experimental,
1038            date: field_date,
1039            publisher: field_publisher,
1040            contact: field_contact,
1041            description: field_description,
1042            use_context: field_use_context,
1043            jurisdiction: field_jurisdiction,
1044            purpose: field_purpose,
1045            copyright: field_copyright,
1046            kind: field_kind,
1047            software: field_software,
1048            implementation: field_implementation,
1049            locked_date: field_locked_date,
1050            code_system: field_code_system,
1051            expansion: field_expansion,
1052            code_search: field_code_search,
1053            validate_code: field_validate_code,
1054            translation: field_translation,
1055            closure: field_closure,
1056        })
1057    }
1058}
1059
1060impl serde::Serialize for TerminologyCapabilities {
1061    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
1062        let mut map = serde::Serializer::serialize_map(serializer, None)?;
1063        if let Some(item) = &self.code_search {
1064            super::super::codec::element_entry(&mut map, "_codeSearch", item)?;
1065        }
1066        if let Some(item) = &self.copyright {
1067            super::super::codec::element_entry(&mut map, "_copyright", item)?;
1068        }
1069        super::super::codec::element_entry(&mut map, "_date", &self.date)?;
1070        if let Some(item) = &self.description {
1071            super::super::codec::element_entry(&mut map, "_description", item)?;
1072        }
1073        if let Some(item) = &self.experimental {
1074            super::super::codec::element_entry(&mut map, "_experimental", item)?;
1075        }
1076        if let Some(item) = &self.implicit_rules {
1077            super::super::codec::element_entry(&mut map, "_implicitRules", item)?;
1078        }
1079        super::super::codec::element_entry(&mut map, "_kind", &self.kind)?;
1080        if let Some(item) = &self.language {
1081            super::super::codec::element_entry(&mut map, "_language", item)?;
1082        }
1083        if let Some(item) = &self.locked_date {
1084            super::super::codec::element_entry(&mut map, "_lockedDate", item)?;
1085        }
1086        if let Some(item) = &self.name {
1087            super::super::codec::element_entry(&mut map, "_name", item)?;
1088        }
1089        if let Some(item) = &self.publisher {
1090            super::super::codec::element_entry(&mut map, "_publisher", item)?;
1091        }
1092        if let Some(item) = &self.purpose {
1093            super::super::codec::element_entry(&mut map, "_purpose", item)?;
1094        }
1095        super::super::codec::element_entry(&mut map, "_status", &self.status)?;
1096        if let Some(item) = &self.title {
1097            super::super::codec::element_entry(&mut map, "_title", item)?;
1098        }
1099        if let Some(item) = &self.url {
1100            super::super::codec::element_entry(&mut map, "_url", item)?;
1101        }
1102        if let Some(item) = &self.version {
1103            super::super::codec::element_entry(&mut map, "_version", item)?;
1104        }
1105        if let Some(item) = &self.closure {
1106            serde::ser::SerializeMap::serialize_entry(&mut map, "closure", item)?;
1107        }
1108        if let Some(item) = &self.code_search {
1109            super::super::codec::value_entry(&mut map, "codeSearch", item)?;
1110        }
1111        if !self.code_system.is_empty() {
1112            serde::ser::SerializeMap::serialize_entry(&mut map, "codeSystem", &self.code_system)?;
1113        }
1114        if !self.contact.is_empty() {
1115            serde::ser::SerializeMap::serialize_entry(&mut map, "contact", &self.contact)?;
1116        }
1117        if !self.contained.is_empty() {
1118            serde::ser::SerializeMap::serialize_entry(&mut map, "contained", &self.contained)?;
1119        }
1120        if let Some(item) = &self.copyright {
1121            super::super::codec::value_entry(&mut map, "copyright", item)?;
1122        }
1123        super::super::codec::value_entry(&mut map, "date", &self.date)?;
1124        if let Some(item) = &self.description {
1125            super::super::codec::value_entry(&mut map, "description", item)?;
1126        }
1127        if let Some(item) = &self.expansion {
1128            serde::ser::SerializeMap::serialize_entry(&mut map, "expansion", item)?;
1129        }
1130        if let Some(item) = &self.experimental {
1131            super::super::codec::value_entry(&mut map, "experimental", item)?;
1132        }
1133        if !self.extension.is_empty() {
1134            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
1135        }
1136        if let Some(v) = &self.id {
1137            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
1138        }
1139        if let Some(item) = &self.implementation {
1140            serde::ser::SerializeMap::serialize_entry(&mut map, "implementation", item)?;
1141        }
1142        if let Some(item) = &self.implicit_rules {
1143            super::super::codec::value_entry(&mut map, "implicitRules", item)?;
1144        }
1145        if !self.jurisdiction.is_empty() {
1146            serde::ser::SerializeMap::serialize_entry(
1147                &mut map,
1148                "jurisdiction",
1149                &self.jurisdiction,
1150            )?;
1151        }
1152        super::super::codec::value_entry(&mut map, "kind", &self.kind)?;
1153        if let Some(item) = &self.language {
1154            super::super::codec::value_entry(&mut map, "language", item)?;
1155        }
1156        if let Some(item) = &self.locked_date {
1157            super::super::codec::value_entry(&mut map, "lockedDate", item)?;
1158        }
1159        if let Some(item) = &self.meta {
1160            serde::ser::SerializeMap::serialize_entry(&mut map, "meta", item)?;
1161        }
1162        if !self.modifier_extension.is_empty() {
1163            serde::ser::SerializeMap::serialize_entry(
1164                &mut map,
1165                "modifierExtension",
1166                &self.modifier_extension,
1167            )?;
1168        }
1169        if let Some(item) = &self.name {
1170            super::super::codec::value_entry(&mut map, "name", item)?;
1171        }
1172        if let Some(item) = &self.publisher {
1173            super::super::codec::value_entry(&mut map, "publisher", item)?;
1174        }
1175        if let Some(item) = &self.purpose {
1176            super::super::codec::value_entry(&mut map, "purpose", item)?;
1177        }
1178        serde::ser::SerializeMap::serialize_entry(
1179            &mut map,
1180            "resourceType",
1181            "TerminologyCapabilities",
1182        )?;
1183        if let Some(item) = &self.software {
1184            serde::ser::SerializeMap::serialize_entry(&mut map, "software", item)?;
1185        }
1186        super::super::codec::value_entry(&mut map, "status", &self.status)?;
1187        if let Some(item) = &self.text {
1188            serde::ser::SerializeMap::serialize_entry(&mut map, "text", item)?;
1189        }
1190        if let Some(item) = &self.title {
1191            super::super::codec::value_entry(&mut map, "title", item)?;
1192        }
1193        if let Some(item) = &self.translation {
1194            serde::ser::SerializeMap::serialize_entry(&mut map, "translation", item)?;
1195        }
1196        if let Some(item) = &self.url {
1197            super::super::codec::value_entry(&mut map, "url", item)?;
1198        }
1199        if !self.use_context.is_empty() {
1200            serde::ser::SerializeMap::serialize_entry(&mut map, "useContext", &self.use_context)?;
1201        }
1202        if let Some(item) = &self.validate_code {
1203            serde::ser::SerializeMap::serialize_entry(&mut map, "validateCode", item)?;
1204        }
1205        if let Some(item) = &self.version {
1206            super::super::codec::value_entry(&mut map, "version", item)?;
1207        }
1208        serde::ser::SerializeMap::end(map)
1209    }
1210}
1211
1212impl<'de> serde::Deserialize<'de> for TerminologyCapabilities {
1213    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1214        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
1215        let mut path = super::super::codec::Path::root("TerminologyCapabilities");
1216        let object =
1217            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
1218        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
1219    }
1220}
1221
1222/// Information about the
1223/// \[ConceptMap/$closure\](conceptmap-operation-closure.html) operation
1224///
1225/// Whether the $closure operation is supported.
1226#[derive(Debug, Clone, Default, PartialEq, Eq)]
1227pub struct TerminologyCapabilitiesClosure {
1228    /// Unique id for inter-element referencing
1229    ///
1230    /// Unique id for the element within a resource (for internal references). This
1231    /// may be any string value that does not contain spaces.
1232    pub id: Option<std::string::String>,
1233    /// Additional content defined by implementations
1234    ///
1235    /// May be used to represent additional information that is not part of the
1236    /// basic definition of the element. To make the use of extensions safe and
1237    /// manageable, there is a strict set of governance applied to the definition
1238    /// and use of extensions. Though any implementer can define an extension, there
1239    /// is a set of requirements that SHALL be met as part of the definition of the
1240    /// extension.
1241    pub extension: Vec<super::extension::Extension>,
1242    /// Extensions that cannot be ignored even if unrecognized
1243    ///
1244    /// May be used to represent additional information that is not part of the
1245    /// basic definition of the element and that modifies the understanding of the
1246    /// element in which it is contained and/or the understanding of the containing
1247    /// element's descendants. Usually modifier elements provide negation or
1248    /// qualification. To make the use of extensions safe and manageable, there is a
1249    /// strict set of governance applied to the definition and use of extensions.
1250    /// Though any implementer can define an extension, there is a set of
1251    /// requirements that SHALL be met as part of the definition of the extension.
1252    /// Applications processing a resource are required to check for modifier
1253    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
1254    /// on Resource or DomainResource (including cannot change the meaning of
1255    /// modifierExtension itself).
1256    pub modifier_extension: Vec<super::extension::Extension>,
1257    /// If cross-system closure is supported.
1258    pub translation: Option<super::primitives::Boolean>,
1259}
1260
1261impl super::super::codec::Json for TerminologyCapabilitiesClosure {
1262    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
1263        let mut object = super::super::codec::Object::new();
1264        if let Some(v) = &self.id {
1265            object.insert(
1266                std::string::String::from("id"),
1267                super::super::codec::Value::String(v.clone()),
1268            );
1269        }
1270        if !self.extension.is_empty() {
1271            let mut items = Vec::with_capacity(self.extension.len());
1272            for item in &self.extension {
1273                items.push(super::super::codec::Value::Object(
1274                    super::super::codec::Json::to_json(item)?,
1275                ));
1276            }
1277            object.insert(
1278                std::string::String::from("extension"),
1279                super::super::codec::Value::Array(items),
1280            );
1281        }
1282        if !self.modifier_extension.is_empty() {
1283            let mut items = Vec::with_capacity(self.modifier_extension.len());
1284            for item in &self.modifier_extension {
1285                items.push(super::super::codec::Value::Object(
1286                    super::super::codec::Json::to_json(item)?,
1287                ));
1288            }
1289            object.insert(
1290                std::string::String::from("modifierExtension"),
1291                super::super::codec::Value::Array(items),
1292            );
1293        }
1294        if let Some(item) = &self.translation {
1295            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
1296                object.insert(std::string::String::from("translation"), v);
1297            }
1298            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
1299                object.insert(std::string::String::from("_translation"), e);
1300            }
1301        }
1302        Ok(object)
1303    }
1304
1305    fn from_json(
1306        object: &super::super::codec::Object,
1307        path: &mut super::super::codec::Path,
1308    ) -> Result<Self, super::super::codec::DecodeError> {
1309        let mut raw_id: Option<&super::super::codec::Value> = None;
1310        let mut raw_extension: Option<&super::super::codec::Value> = None;
1311        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
1312        let mut raw_translation: Option<&super::super::codec::Value> = None;
1313        let mut raw_translation_element: Option<&super::super::codec::Value> = None;
1314        for (key, value) in object {
1315            match key.as_str() {
1316                "id" => {
1317                    raw_id = Some(value);
1318                }
1319                "extension" => {
1320                    raw_extension = Some(value);
1321                }
1322                "modifierExtension" => {
1323                    raw_modifier_extension = Some(value);
1324                }
1325                "translation" => {
1326                    raw_translation = Some(value);
1327                }
1328                "_translation" => {
1329                    raw_translation_element = Some(value);
1330                }
1331                other => {
1332                    return path.with(other, |path| {
1333                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
1334                    });
1335                }
1336            }
1337        }
1338        let field_id = raw_id
1339            .map(|value| {
1340                path.with("id", |path| {
1341                    let value = super::super::codec::expect_single(value, path)?;
1342                    super::primitives::checked_string(
1343                        super::super::codec::expect_string(value, path)?,
1344                        path,
1345                    )
1346                })
1347            })
1348            .transpose()?;
1349        let mut field_extension = Vec::new();
1350        if let Some(raw) = raw_extension {
1351            for (index, value) in path
1352                .with("extension", |path| {
1353                    super::super::codec::expect_array(raw, path)
1354                })?
1355                .iter()
1356                .enumerate()
1357            {
1358                field_extension.push(path.with_index("extension", index, |path| {
1359                    super::super::codec::Json::from_json(
1360                        super::super::codec::expect_object(value, path)?,
1361                        path,
1362                    )
1363                })?);
1364            }
1365        }
1366        let mut field_modifier_extension = Vec::new();
1367        if let Some(raw) = raw_modifier_extension {
1368            for (index, value) in path
1369                .with("modifierExtension", |path| {
1370                    super::super::codec::expect_array(raw, path)
1371                })?
1372                .iter()
1373                .enumerate()
1374            {
1375                field_modifier_extension.push(path.with_index(
1376                    "modifierExtension",
1377                    index,
1378                    |path| {
1379                        super::super::codec::Json::from_json(
1380                            super::super::codec::expect_object(value, path)?,
1381                            path,
1382                        )
1383                    },
1384                )?);
1385            }
1386        }
1387        let field_translation = match (raw_translation, raw_translation_element) {
1388            (None, None) => None,
1389            (value, element) => Some(path.with("translation", |path| {
1390                super::super::codec::Primitive::from_json_parts(value, element, path)
1391            })?),
1392        };
1393        Ok(Self {
1394            id: field_id,
1395            extension: field_extension,
1396            modifier_extension: field_modifier_extension,
1397            translation: field_translation,
1398        })
1399    }
1400}
1401
1402impl serde::Serialize for TerminologyCapabilitiesClosure {
1403    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
1404        let mut map = serde::Serializer::serialize_map(serializer, None)?;
1405        if let Some(item) = &self.translation {
1406            super::super::codec::element_entry(&mut map, "_translation", item)?;
1407        }
1408        if !self.extension.is_empty() {
1409            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
1410        }
1411        if let Some(v) = &self.id {
1412            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
1413        }
1414        if !self.modifier_extension.is_empty() {
1415            serde::ser::SerializeMap::serialize_entry(
1416                &mut map,
1417                "modifierExtension",
1418                &self.modifier_extension,
1419            )?;
1420        }
1421        if let Some(item) = &self.translation {
1422            super::super::codec::value_entry(&mut map, "translation", item)?;
1423        }
1424        serde::ser::SerializeMap::end(map)
1425    }
1426}
1427
1428impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesClosure {
1429    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1430        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
1431        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesClosure");
1432        let object =
1433            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
1434        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
1435    }
1436}
1437
1438/// A code system supported by the server
1439///
1440/// Identifies a code system that is supported by the server. If there is a no
1441/// code system URL, then this declares the general assumptions a client can
1442/// make about support for any CodeSystem resource.
1443#[derive(Debug, Clone, Default, PartialEq, Eq)]
1444pub struct TerminologyCapabilitiesCodeSystem {
1445    /// Unique id for inter-element referencing
1446    ///
1447    /// Unique id for the element within a resource (for internal references). This
1448    /// may be any string value that does not contain spaces.
1449    pub id: Option<std::string::String>,
1450    /// Additional content defined by implementations
1451    ///
1452    /// May be used to represent additional information that is not part of the
1453    /// basic definition of the element. To make the use of extensions safe and
1454    /// manageable, there is a strict set of governance applied to the definition
1455    /// and use of extensions. Though any implementer can define an extension, there
1456    /// is a set of requirements that SHALL be met as part of the definition of the
1457    /// extension.
1458    pub extension: Vec<super::extension::Extension>,
1459    /// Extensions that cannot be ignored even if unrecognized
1460    ///
1461    /// May be used to represent additional information that is not part of the
1462    /// basic definition of the element and that modifies the understanding of the
1463    /// element in which it is contained and/or the understanding of the containing
1464    /// element's descendants. Usually modifier elements provide negation or
1465    /// qualification. To make the use of extensions safe and manageable, there is a
1466    /// strict set of governance applied to the definition and use of extensions.
1467    /// Though any implementer can define an extension, there is a set of
1468    /// requirements that SHALL be met as part of the definition of the extension.
1469    /// Applications processing a resource are required to check for modifier
1470    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
1471    /// on Resource or DomainResource (including cannot change the meaning of
1472    /// modifierExtension itself).
1473    pub modifier_extension: Vec<super::extension::Extension>,
1474    /// URI for the Code System.
1475    pub uri: Option<super::primitives::Canonical>,
1476    /// Version of Code System supported
1477    ///
1478    /// For the code system, a list of versions that are supported by the server.
1479    pub version: Vec<TerminologyCapabilitiesCodeSystemVersion>,
1480    /// Whether subsumption is supported
1481    ///
1482    /// True if subsumption is supported for this version of the code system.
1483    pub subsumption: Option<super::primitives::Boolean>,
1484}
1485
1486impl super::super::codec::Json for TerminologyCapabilitiesCodeSystem {
1487    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
1488        let mut object = super::super::codec::Object::new();
1489        if let Some(v) = &self.id {
1490            object.insert(
1491                std::string::String::from("id"),
1492                super::super::codec::Value::String(v.clone()),
1493            );
1494        }
1495        if !self.extension.is_empty() {
1496            let mut items = Vec::with_capacity(self.extension.len());
1497            for item in &self.extension {
1498                items.push(super::super::codec::Value::Object(
1499                    super::super::codec::Json::to_json(item)?,
1500                ));
1501            }
1502            object.insert(
1503                std::string::String::from("extension"),
1504                super::super::codec::Value::Array(items),
1505            );
1506        }
1507        if !self.modifier_extension.is_empty() {
1508            let mut items = Vec::with_capacity(self.modifier_extension.len());
1509            for item in &self.modifier_extension {
1510                items.push(super::super::codec::Value::Object(
1511                    super::super::codec::Json::to_json(item)?,
1512                ));
1513            }
1514            object.insert(
1515                std::string::String::from("modifierExtension"),
1516                super::super::codec::Value::Array(items),
1517            );
1518        }
1519        if let Some(item) = &self.uri {
1520            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
1521                object.insert(std::string::String::from("uri"), v);
1522            }
1523            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
1524                object.insert(std::string::String::from("_uri"), e);
1525            }
1526        }
1527        if !self.version.is_empty() {
1528            let mut items = Vec::with_capacity(self.version.len());
1529            for item in &self.version {
1530                items.push(super::super::codec::Value::Object(
1531                    super::super::codec::Json::to_json(item)?,
1532                ));
1533            }
1534            object.insert(
1535                std::string::String::from("version"),
1536                super::super::codec::Value::Array(items),
1537            );
1538        }
1539        if let Some(item) = &self.subsumption {
1540            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
1541                object.insert(std::string::String::from("subsumption"), v);
1542            }
1543            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
1544                object.insert(std::string::String::from("_subsumption"), e);
1545            }
1546        }
1547        Ok(object)
1548    }
1549
1550    fn from_json(
1551        object: &super::super::codec::Object,
1552        path: &mut super::super::codec::Path,
1553    ) -> Result<Self, super::super::codec::DecodeError> {
1554        let mut raw_id: Option<&super::super::codec::Value> = None;
1555        let mut raw_extension: Option<&super::super::codec::Value> = None;
1556        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
1557        let mut raw_uri: Option<&super::super::codec::Value> = None;
1558        let mut raw_uri_element: Option<&super::super::codec::Value> = None;
1559        let mut raw_version: Option<&super::super::codec::Value> = None;
1560        let mut raw_subsumption: Option<&super::super::codec::Value> = None;
1561        let mut raw_subsumption_element: Option<&super::super::codec::Value> = None;
1562        for (key, value) in object {
1563            match key.as_str() {
1564                "id" => {
1565                    raw_id = Some(value);
1566                }
1567                "extension" => {
1568                    raw_extension = Some(value);
1569                }
1570                "modifierExtension" => {
1571                    raw_modifier_extension = Some(value);
1572                }
1573                "uri" => {
1574                    raw_uri = Some(value);
1575                }
1576                "_uri" => {
1577                    raw_uri_element = Some(value);
1578                }
1579                "version" => {
1580                    raw_version = Some(value);
1581                }
1582                "subsumption" => {
1583                    raw_subsumption = Some(value);
1584                }
1585                "_subsumption" => {
1586                    raw_subsumption_element = Some(value);
1587                }
1588                other => {
1589                    return path.with(other, |path| {
1590                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
1591                    });
1592                }
1593            }
1594        }
1595        let field_id = raw_id
1596            .map(|value| {
1597                path.with("id", |path| {
1598                    let value = super::super::codec::expect_single(value, path)?;
1599                    super::primitives::checked_string(
1600                        super::super::codec::expect_string(value, path)?,
1601                        path,
1602                    )
1603                })
1604            })
1605            .transpose()?;
1606        let mut field_extension = Vec::new();
1607        if let Some(raw) = raw_extension {
1608            for (index, value) in path
1609                .with("extension", |path| {
1610                    super::super::codec::expect_array(raw, path)
1611                })?
1612                .iter()
1613                .enumerate()
1614            {
1615                field_extension.push(path.with_index("extension", index, |path| {
1616                    super::super::codec::Json::from_json(
1617                        super::super::codec::expect_object(value, path)?,
1618                        path,
1619                    )
1620                })?);
1621            }
1622        }
1623        let mut field_modifier_extension = Vec::new();
1624        if let Some(raw) = raw_modifier_extension {
1625            for (index, value) in path
1626                .with("modifierExtension", |path| {
1627                    super::super::codec::expect_array(raw, path)
1628                })?
1629                .iter()
1630                .enumerate()
1631            {
1632                field_modifier_extension.push(path.with_index(
1633                    "modifierExtension",
1634                    index,
1635                    |path| {
1636                        super::super::codec::Json::from_json(
1637                            super::super::codec::expect_object(value, path)?,
1638                            path,
1639                        )
1640                    },
1641                )?);
1642            }
1643        }
1644        let field_uri = match (raw_uri, raw_uri_element) {
1645            (None, None) => None,
1646            (value, element) => Some(path.with("uri", |path| {
1647                super::super::codec::Primitive::from_json_parts(value, element, path)
1648            })?),
1649        };
1650        let mut field_version = Vec::new();
1651        if let Some(raw) = raw_version {
1652            for (index, value) in path
1653                .with("version", |path| {
1654                    super::super::codec::expect_array(raw, path)
1655                })?
1656                .iter()
1657                .enumerate()
1658            {
1659                field_version.push(path.with_index("version", index, |path| {
1660                    super::super::codec::Json::from_json(
1661                        super::super::codec::expect_object(value, path)?,
1662                        path,
1663                    )
1664                })?);
1665            }
1666        }
1667        let field_subsumption = match (raw_subsumption, raw_subsumption_element) {
1668            (None, None) => None,
1669            (value, element) => Some(path.with("subsumption", |path| {
1670                super::super::codec::Primitive::from_json_parts(value, element, path)
1671            })?),
1672        };
1673        Ok(Self {
1674            id: field_id,
1675            extension: field_extension,
1676            modifier_extension: field_modifier_extension,
1677            uri: field_uri,
1678            version: field_version,
1679            subsumption: field_subsumption,
1680        })
1681    }
1682}
1683
1684impl serde::Serialize for TerminologyCapabilitiesCodeSystem {
1685    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
1686        let mut map = serde::Serializer::serialize_map(serializer, None)?;
1687        if let Some(item) = &self.subsumption {
1688            super::super::codec::element_entry(&mut map, "_subsumption", item)?;
1689        }
1690        if let Some(item) = &self.uri {
1691            super::super::codec::element_entry(&mut map, "_uri", item)?;
1692        }
1693        if !self.extension.is_empty() {
1694            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
1695        }
1696        if let Some(v) = &self.id {
1697            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
1698        }
1699        if !self.modifier_extension.is_empty() {
1700            serde::ser::SerializeMap::serialize_entry(
1701                &mut map,
1702                "modifierExtension",
1703                &self.modifier_extension,
1704            )?;
1705        }
1706        if let Some(item) = &self.subsumption {
1707            super::super::codec::value_entry(&mut map, "subsumption", item)?;
1708        }
1709        if let Some(item) = &self.uri {
1710            super::super::codec::value_entry(&mut map, "uri", item)?;
1711        }
1712        if !self.version.is_empty() {
1713            serde::ser::SerializeMap::serialize_entry(&mut map, "version", &self.version)?;
1714        }
1715        serde::ser::SerializeMap::end(map)
1716    }
1717}
1718
1719impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesCodeSystem {
1720    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1721        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
1722        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesCodeSystem");
1723        let object =
1724            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
1725        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
1726    }
1727}
1728
1729/// Version of Code System supported
1730///
1731/// For the code system, a list of versions that are supported by the server.
1732#[derive(Debug, Clone, Default, PartialEq, Eq)]
1733pub struct TerminologyCapabilitiesCodeSystemVersion {
1734    /// Unique id for inter-element referencing
1735    ///
1736    /// Unique id for the element within a resource (for internal references). This
1737    /// may be any string value that does not contain spaces.
1738    pub id: Option<std::string::String>,
1739    /// Additional content defined by implementations
1740    ///
1741    /// May be used to represent additional information that is not part of the
1742    /// basic definition of the element. To make the use of extensions safe and
1743    /// manageable, there is a strict set of governance applied to the definition
1744    /// and use of extensions. Though any implementer can define an extension, there
1745    /// is a set of requirements that SHALL be met as part of the definition of the
1746    /// extension.
1747    pub extension: Vec<super::extension::Extension>,
1748    /// Extensions that cannot be ignored even if unrecognized
1749    ///
1750    /// May be used to represent additional information that is not part of the
1751    /// basic definition of the element and that modifies the understanding of the
1752    /// element in which it is contained and/or the understanding of the containing
1753    /// element's descendants. Usually modifier elements provide negation or
1754    /// qualification. To make the use of extensions safe and manageable, there is a
1755    /// strict set of governance applied to the definition and use of extensions.
1756    /// Though any implementer can define an extension, there is a set of
1757    /// requirements that SHALL be met as part of the definition of the extension.
1758    /// Applications processing a resource are required to check for modifier
1759    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
1760    /// on Resource or DomainResource (including cannot change the meaning of
1761    /// modifierExtension itself).
1762    pub modifier_extension: Vec<super::extension::Extension>,
1763    /// Version identifier for this version
1764    ///
1765    /// For version-less code systems, there should be a single version with no
1766    /// identifier.
1767    pub code: Option<super::primitives::String>,
1768    /// If this is the default version for this code system.
1769    pub is_default: Option<super::primitives::Boolean>,
1770    /// If compositional grammar is supported
1771    ///
1772    /// If the compositional grammar defined by the code system is supported.
1773    pub compositional: Option<super::primitives::Boolean>,
1774    /// Language Displays supported.
1775    pub language: Vec<super::primitives::Code>,
1776    /// Filter Properties supported.
1777    pub filter: Vec<TerminologyCapabilitiesCodeSystemVersionFilter>,
1778    /// Properties supported for $lookup.
1779    pub property: Vec<super::primitives::Code>,
1780}
1781
1782impl super::super::codec::Json for TerminologyCapabilitiesCodeSystemVersion {
1783    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
1784        let mut object = super::super::codec::Object::new();
1785        if let Some(v) = &self.id {
1786            object.insert(
1787                std::string::String::from("id"),
1788                super::super::codec::Value::String(v.clone()),
1789            );
1790        }
1791        if !self.extension.is_empty() {
1792            let mut items = Vec::with_capacity(self.extension.len());
1793            for item in &self.extension {
1794                items.push(super::super::codec::Value::Object(
1795                    super::super::codec::Json::to_json(item)?,
1796                ));
1797            }
1798            object.insert(
1799                std::string::String::from("extension"),
1800                super::super::codec::Value::Array(items),
1801            );
1802        }
1803        if !self.modifier_extension.is_empty() {
1804            let mut items = Vec::with_capacity(self.modifier_extension.len());
1805            for item in &self.modifier_extension {
1806                items.push(super::super::codec::Value::Object(
1807                    super::super::codec::Json::to_json(item)?,
1808                ));
1809            }
1810            object.insert(
1811                std::string::String::from("modifierExtension"),
1812                super::super::codec::Value::Array(items),
1813            );
1814        }
1815        if let Some(item) = &self.code {
1816            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
1817                object.insert(std::string::String::from("code"), v);
1818            }
1819            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
1820                object.insert(std::string::String::from("_code"), e);
1821            }
1822        }
1823        if let Some(item) = &self.is_default {
1824            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
1825                object.insert(std::string::String::from("isDefault"), v);
1826            }
1827            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
1828                object.insert(std::string::String::from("_isDefault"), e);
1829            }
1830        }
1831        if let Some(item) = &self.compositional {
1832            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
1833                object.insert(std::string::String::from("compositional"), v);
1834            }
1835            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
1836                object.insert(std::string::String::from("_compositional"), e);
1837            }
1838        }
1839        if !self.language.is_empty() {
1840            let (values, elements) = super::super::codec::primitive_arrays(&self.language)?;
1841            if let Some(values) = values {
1842                object.insert(std::string::String::from("language"), values);
1843            }
1844            if let Some(elements) = elements {
1845                object.insert(std::string::String::from("_language"), elements);
1846            }
1847        }
1848        if !self.filter.is_empty() {
1849            let mut items = Vec::with_capacity(self.filter.len());
1850            for item in &self.filter {
1851                items.push(super::super::codec::Value::Object(
1852                    super::super::codec::Json::to_json(item)?,
1853                ));
1854            }
1855            object.insert(
1856                std::string::String::from("filter"),
1857                super::super::codec::Value::Array(items),
1858            );
1859        }
1860        if !self.property.is_empty() {
1861            let (values, elements) = super::super::codec::primitive_arrays(&self.property)?;
1862            if let Some(values) = values {
1863                object.insert(std::string::String::from("property"), values);
1864            }
1865            if let Some(elements) = elements {
1866                object.insert(std::string::String::from("_property"), elements);
1867            }
1868        }
1869        Ok(object)
1870    }
1871
1872    fn from_json(
1873        object: &super::super::codec::Object,
1874        path: &mut super::super::codec::Path,
1875    ) -> Result<Self, super::super::codec::DecodeError> {
1876        let mut raw_id: Option<&super::super::codec::Value> = None;
1877        let mut raw_extension: Option<&super::super::codec::Value> = None;
1878        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
1879        let mut raw_code: Option<&super::super::codec::Value> = None;
1880        let mut raw_code_element: Option<&super::super::codec::Value> = None;
1881        let mut raw_is_default: Option<&super::super::codec::Value> = None;
1882        let mut raw_is_default_element: Option<&super::super::codec::Value> = None;
1883        let mut raw_compositional: Option<&super::super::codec::Value> = None;
1884        let mut raw_compositional_element: Option<&super::super::codec::Value> = None;
1885        let mut raw_language: Option<&super::super::codec::Value> = None;
1886        let mut raw_language_element: Option<&super::super::codec::Value> = None;
1887        let mut raw_filter: Option<&super::super::codec::Value> = None;
1888        let mut raw_property: Option<&super::super::codec::Value> = None;
1889        let mut raw_property_element: Option<&super::super::codec::Value> = None;
1890        for (key, value) in object {
1891            match key.as_str() {
1892                "id" => {
1893                    raw_id = Some(value);
1894                }
1895                "extension" => {
1896                    raw_extension = Some(value);
1897                }
1898                "modifierExtension" => {
1899                    raw_modifier_extension = Some(value);
1900                }
1901                "code" => {
1902                    raw_code = Some(value);
1903                }
1904                "_code" => {
1905                    raw_code_element = Some(value);
1906                }
1907                "isDefault" => {
1908                    raw_is_default = Some(value);
1909                }
1910                "_isDefault" => {
1911                    raw_is_default_element = Some(value);
1912                }
1913                "compositional" => {
1914                    raw_compositional = Some(value);
1915                }
1916                "_compositional" => {
1917                    raw_compositional_element = Some(value);
1918                }
1919                "language" => {
1920                    raw_language = Some(value);
1921                }
1922                "_language" => {
1923                    raw_language_element = Some(value);
1924                }
1925                "filter" => {
1926                    raw_filter = Some(value);
1927                }
1928                "property" => {
1929                    raw_property = Some(value);
1930                }
1931                "_property" => {
1932                    raw_property_element = Some(value);
1933                }
1934                other => {
1935                    return path.with(other, |path| {
1936                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
1937                    });
1938                }
1939            }
1940        }
1941        let field_id = raw_id
1942            .map(|value| {
1943                path.with("id", |path| {
1944                    let value = super::super::codec::expect_single(value, path)?;
1945                    super::primitives::checked_string(
1946                        super::super::codec::expect_string(value, path)?,
1947                        path,
1948                    )
1949                })
1950            })
1951            .transpose()?;
1952        let mut field_extension = Vec::new();
1953        if let Some(raw) = raw_extension {
1954            for (index, value) in path
1955                .with("extension", |path| {
1956                    super::super::codec::expect_array(raw, path)
1957                })?
1958                .iter()
1959                .enumerate()
1960            {
1961                field_extension.push(path.with_index("extension", index, |path| {
1962                    super::super::codec::Json::from_json(
1963                        super::super::codec::expect_object(value, path)?,
1964                        path,
1965                    )
1966                })?);
1967            }
1968        }
1969        let mut field_modifier_extension = Vec::new();
1970        if let Some(raw) = raw_modifier_extension {
1971            for (index, value) in path
1972                .with("modifierExtension", |path| {
1973                    super::super::codec::expect_array(raw, path)
1974                })?
1975                .iter()
1976                .enumerate()
1977            {
1978                field_modifier_extension.push(path.with_index(
1979                    "modifierExtension",
1980                    index,
1981                    |path| {
1982                        super::super::codec::Json::from_json(
1983                            super::super::codec::expect_object(value, path)?,
1984                            path,
1985                        )
1986                    },
1987                )?);
1988            }
1989        }
1990        let field_code = match (raw_code, raw_code_element) {
1991            (None, None) => None,
1992            (value, element) => Some(path.with("code", |path| {
1993                super::super::codec::Primitive::from_json_parts(value, element, path)
1994            })?),
1995        };
1996        let field_is_default = match (raw_is_default, raw_is_default_element) {
1997            (None, None) => None,
1998            (value, element) => Some(path.with("isDefault", |path| {
1999                super::super::codec::Primitive::from_json_parts(value, element, path)
2000            })?),
2001        };
2002        let field_compositional = match (raw_compositional, raw_compositional_element) {
2003            (None, None) => None,
2004            (value, element) => Some(path.with("compositional", |path| {
2005                super::super::codec::Primitive::from_json_parts(value, element, path)
2006            })?),
2007        };
2008        let mut field_language = Vec::new();
2009        for (index, (value, element)) in path
2010            .with("language", |path| {
2011                super::super::codec::pair_arrays(raw_language, raw_language_element, path)
2012            })?
2013            .into_iter()
2014            .enumerate()
2015        {
2016            field_language.push(path.with_index("language", index, |path| {
2017                super::super::codec::Primitive::from_json_parts(value, element, path)
2018            })?);
2019        }
2020        let mut field_filter = Vec::new();
2021        if let Some(raw) = raw_filter {
2022            for (index, value) in path
2023                .with("filter", |path| {
2024                    super::super::codec::expect_array(raw, path)
2025                })?
2026                .iter()
2027                .enumerate()
2028            {
2029                field_filter.push(path.with_index("filter", index, |path| {
2030                    super::super::codec::Json::from_json(
2031                        super::super::codec::expect_object(value, path)?,
2032                        path,
2033                    )
2034                })?);
2035            }
2036        }
2037        let mut field_property = Vec::new();
2038        for (index, (value, element)) in path
2039            .with("property", |path| {
2040                super::super::codec::pair_arrays(raw_property, raw_property_element, path)
2041            })?
2042            .into_iter()
2043            .enumerate()
2044        {
2045            field_property.push(path.with_index("property", index, |path| {
2046                super::super::codec::Primitive::from_json_parts(value, element, path)
2047            })?);
2048        }
2049        Ok(Self {
2050            id: field_id,
2051            extension: field_extension,
2052            modifier_extension: field_modifier_extension,
2053            code: field_code,
2054            is_default: field_is_default,
2055            compositional: field_compositional,
2056            language: field_language,
2057            filter: field_filter,
2058            property: field_property,
2059        })
2060    }
2061}
2062
2063impl serde::Serialize for TerminologyCapabilitiesCodeSystemVersion {
2064    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
2065        let mut map = serde::Serializer::serialize_map(serializer, None)?;
2066        if let Some(item) = &self.code {
2067            super::super::codec::element_entry(&mut map, "_code", item)?;
2068        }
2069        if let Some(item) = &self.compositional {
2070            super::super::codec::element_entry(&mut map, "_compositional", item)?;
2071        }
2072        if let Some(item) = &self.is_default {
2073            super::super::codec::element_entry(&mut map, "_isDefault", item)?;
2074        }
2075        super::super::codec::element_list_entry(&mut map, "_language", &self.language)?;
2076        super::super::codec::element_list_entry(&mut map, "_property", &self.property)?;
2077        if let Some(item) = &self.code {
2078            super::super::codec::value_entry(&mut map, "code", item)?;
2079        }
2080        if let Some(item) = &self.compositional {
2081            super::super::codec::value_entry(&mut map, "compositional", item)?;
2082        }
2083        if !self.extension.is_empty() {
2084            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
2085        }
2086        if !self.filter.is_empty() {
2087            serde::ser::SerializeMap::serialize_entry(&mut map, "filter", &self.filter)?;
2088        }
2089        if let Some(v) = &self.id {
2090            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
2091        }
2092        if let Some(item) = &self.is_default {
2093            super::super::codec::value_entry(&mut map, "isDefault", item)?;
2094        }
2095        super::super::codec::value_list_entry(&mut map, "language", &self.language)?;
2096        if !self.modifier_extension.is_empty() {
2097            serde::ser::SerializeMap::serialize_entry(
2098                &mut map,
2099                "modifierExtension",
2100                &self.modifier_extension,
2101            )?;
2102        }
2103        super::super::codec::value_list_entry(&mut map, "property", &self.property)?;
2104        serde::ser::SerializeMap::end(map)
2105    }
2106}
2107
2108impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesCodeSystemVersion {
2109    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2110        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
2111        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesCodeSystemVersion");
2112        let object =
2113            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
2114        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
2115    }
2116}
2117
2118/// Filter Properties supported.
2119#[derive(Debug, Clone, Default, PartialEq, Eq)]
2120pub struct TerminologyCapabilitiesCodeSystemVersionFilter {
2121    /// Unique id for inter-element referencing
2122    ///
2123    /// Unique id for the element within a resource (for internal references). This
2124    /// may be any string value that does not contain spaces.
2125    pub id: Option<std::string::String>,
2126    /// Additional content defined by implementations
2127    ///
2128    /// May be used to represent additional information that is not part of the
2129    /// basic definition of the element. To make the use of extensions safe and
2130    /// manageable, there is a strict set of governance applied to the definition
2131    /// and use of extensions. Though any implementer can define an extension, there
2132    /// is a set of requirements that SHALL be met as part of the definition of the
2133    /// extension.
2134    pub extension: Vec<super::extension::Extension>,
2135    /// Extensions that cannot be ignored even if unrecognized
2136    ///
2137    /// May be used to represent additional information that is not part of the
2138    /// basic definition of the element and that modifies the understanding of the
2139    /// element in which it is contained and/or the understanding of the containing
2140    /// element's descendants. Usually modifier elements provide negation or
2141    /// qualification. To make the use of extensions safe and manageable, there is a
2142    /// strict set of governance applied to the definition and use of extensions.
2143    /// Though any implementer can define an extension, there is a set of
2144    /// requirements that SHALL be met as part of the definition of the extension.
2145    /// Applications processing a resource are required to check for modifier
2146    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
2147    /// on Resource or DomainResource (including cannot change the meaning of
2148    /// modifierExtension itself).
2149    pub modifier_extension: Vec<super::extension::Extension>,
2150    /// Code of the property supported.
2151    pub code: super::primitives::Code,
2152    /// Operations supported for the property.
2153    pub op: Vec<super::primitives::Code>,
2154}
2155
2156impl super::super::codec::Json for TerminologyCapabilitiesCodeSystemVersionFilter {
2157    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
2158        let mut object = super::super::codec::Object::new();
2159        if let Some(v) = &self.id {
2160            object.insert(
2161                std::string::String::from("id"),
2162                super::super::codec::Value::String(v.clone()),
2163            );
2164        }
2165        if !self.extension.is_empty() {
2166            let mut items = Vec::with_capacity(self.extension.len());
2167            for item in &self.extension {
2168                items.push(super::super::codec::Value::Object(
2169                    super::super::codec::Json::to_json(item)?,
2170                ));
2171            }
2172            object.insert(
2173                std::string::String::from("extension"),
2174                super::super::codec::Value::Array(items),
2175            );
2176        }
2177        if !self.modifier_extension.is_empty() {
2178            let mut items = Vec::with_capacity(self.modifier_extension.len());
2179            for item in &self.modifier_extension {
2180                items.push(super::super::codec::Value::Object(
2181                    super::super::codec::Json::to_json(item)?,
2182                ));
2183            }
2184            object.insert(
2185                std::string::String::from("modifierExtension"),
2186                super::super::codec::Value::Array(items),
2187            );
2188        }
2189        if let Some(v) = super::super::codec::Primitive::value_json(&self.code)? {
2190            object.insert(std::string::String::from("code"), v);
2191        }
2192        if let Some(e) = super::super::codec::Primitive::element_json(&self.code)? {
2193            object.insert(std::string::String::from("_code"), e);
2194        }
2195        if !self.op.is_empty() {
2196            let (values, elements) = super::super::codec::primitive_arrays(&self.op)?;
2197            if let Some(values) = values {
2198                object.insert(std::string::String::from("op"), values);
2199            }
2200            if let Some(elements) = elements {
2201                object.insert(std::string::String::from("_op"), elements);
2202            }
2203        }
2204        Ok(object)
2205    }
2206
2207    fn from_json(
2208        object: &super::super::codec::Object,
2209        path: &mut super::super::codec::Path,
2210    ) -> Result<Self, super::super::codec::DecodeError> {
2211        let mut raw_id: Option<&super::super::codec::Value> = None;
2212        let mut raw_extension: Option<&super::super::codec::Value> = None;
2213        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
2214        let mut raw_code: Option<&super::super::codec::Value> = None;
2215        let mut raw_code_element: Option<&super::super::codec::Value> = None;
2216        let mut raw_op: Option<&super::super::codec::Value> = None;
2217        let mut raw_op_element: Option<&super::super::codec::Value> = None;
2218        for (key, value) in object {
2219            match key.as_str() {
2220                "id" => {
2221                    raw_id = Some(value);
2222                }
2223                "extension" => {
2224                    raw_extension = Some(value);
2225                }
2226                "modifierExtension" => {
2227                    raw_modifier_extension = Some(value);
2228                }
2229                "code" => {
2230                    raw_code = Some(value);
2231                }
2232                "_code" => {
2233                    raw_code_element = Some(value);
2234                }
2235                "op" => {
2236                    raw_op = Some(value);
2237                }
2238                "_op" => {
2239                    raw_op_element = Some(value);
2240                }
2241                other => {
2242                    return path.with(other, |path| {
2243                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
2244                    });
2245                }
2246            }
2247        }
2248        let field_id = raw_id
2249            .map(|value| {
2250                path.with("id", |path| {
2251                    let value = super::super::codec::expect_single(value, path)?;
2252                    super::primitives::checked_string(
2253                        super::super::codec::expect_string(value, path)?,
2254                        path,
2255                    )
2256                })
2257            })
2258            .transpose()?;
2259        let mut field_extension = Vec::new();
2260        if let Some(raw) = raw_extension {
2261            for (index, value) in path
2262                .with("extension", |path| {
2263                    super::super::codec::expect_array(raw, path)
2264                })?
2265                .iter()
2266                .enumerate()
2267            {
2268                field_extension.push(path.with_index("extension", index, |path| {
2269                    super::super::codec::Json::from_json(
2270                        super::super::codec::expect_object(value, path)?,
2271                        path,
2272                    )
2273                })?);
2274            }
2275        }
2276        let mut field_modifier_extension = Vec::new();
2277        if let Some(raw) = raw_modifier_extension {
2278            for (index, value) in path
2279                .with("modifierExtension", |path| {
2280                    super::super::codec::expect_array(raw, path)
2281                })?
2282                .iter()
2283                .enumerate()
2284            {
2285                field_modifier_extension.push(path.with_index(
2286                    "modifierExtension",
2287                    index,
2288                    |path| {
2289                        super::super::codec::Json::from_json(
2290                            super::super::codec::expect_object(value, path)?,
2291                            path,
2292                        )
2293                    },
2294                )?);
2295            }
2296        }
2297        let field_code = path.with("code", |path| {
2298            super::super::codec::Primitive::from_json_parts(raw_code, raw_code_element, path)
2299        })?;
2300        let mut field_op = Vec::new();
2301        for (index, (value, element)) in path
2302            .with("op", |path| {
2303                super::super::codec::pair_arrays(raw_op, raw_op_element, path)
2304            })?
2305            .into_iter()
2306            .enumerate()
2307        {
2308            field_op.push(path.with_index("op", index, |path| {
2309                super::super::codec::Primitive::from_json_parts(value, element, path)
2310            })?);
2311        }
2312        if field_op.is_empty() && !path.is_lenient() {
2313            return path.with("op", |path| {
2314                Err(path.error(super::super::codec::DecodeErrorKind::MissingProperty))
2315            });
2316        }
2317        Ok(Self {
2318            id: field_id,
2319            extension: field_extension,
2320            modifier_extension: field_modifier_extension,
2321            code: field_code,
2322            op: field_op,
2323        })
2324    }
2325}
2326
2327impl serde::Serialize for TerminologyCapabilitiesCodeSystemVersionFilter {
2328    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
2329        let mut map = serde::Serializer::serialize_map(serializer, None)?;
2330        super::super::codec::element_entry(&mut map, "_code", &self.code)?;
2331        super::super::codec::element_list_entry(&mut map, "_op", &self.op)?;
2332        super::super::codec::value_entry(&mut map, "code", &self.code)?;
2333        if !self.extension.is_empty() {
2334            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
2335        }
2336        if let Some(v) = &self.id {
2337            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
2338        }
2339        if !self.modifier_extension.is_empty() {
2340            serde::ser::SerializeMap::serialize_entry(
2341                &mut map,
2342                "modifierExtension",
2343                &self.modifier_extension,
2344            )?;
2345        }
2346        super::super::codec::value_list_entry(&mut map, "op", &self.op)?;
2347        serde::ser::SerializeMap::end(map)
2348    }
2349}
2350
2351impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesCodeSystemVersionFilter {
2352    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2353        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
2354        let mut path =
2355            super::super::codec::Path::root("TerminologyCapabilitiesCodeSystemVersionFilter");
2356        let object =
2357            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
2358        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
2359    }
2360}
2361
2362/// Information about the \[ValueSet/$expand\](valueset-operation-expand.html)
2363/// operation.
2364#[derive(Debug, Clone, Default, PartialEq, Eq)]
2365pub struct TerminologyCapabilitiesExpansion {
2366    /// Unique id for inter-element referencing
2367    ///
2368    /// Unique id for the element within a resource (for internal references). This
2369    /// may be any string value that does not contain spaces.
2370    pub id: Option<std::string::String>,
2371    /// Additional content defined by implementations
2372    ///
2373    /// May be used to represent additional information that is not part of the
2374    /// basic definition of the element. To make the use of extensions safe and
2375    /// manageable, there is a strict set of governance applied to the definition
2376    /// and use of extensions. Though any implementer can define an extension, there
2377    /// is a set of requirements that SHALL be met as part of the definition of the
2378    /// extension.
2379    pub extension: Vec<super::extension::Extension>,
2380    /// Extensions that cannot be ignored even if unrecognized
2381    ///
2382    /// May be used to represent additional information that is not part of the
2383    /// basic definition of the element and that modifies the understanding of the
2384    /// element in which it is contained and/or the understanding of the containing
2385    /// element's descendants. Usually modifier elements provide negation or
2386    /// qualification. To make the use of extensions safe and manageable, there is a
2387    /// strict set of governance applied to the definition and use of extensions.
2388    /// Though any implementer can define an extension, there is a set of
2389    /// requirements that SHALL be met as part of the definition of the extension.
2390    /// Applications processing a resource are required to check for modifier
2391    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
2392    /// on Resource or DomainResource (including cannot change the meaning of
2393    /// modifierExtension itself).
2394    pub modifier_extension: Vec<super::extension::Extension>,
2395    /// Whether the server can return nested value sets.
2396    pub hierarchical: Option<super::primitives::Boolean>,
2397    /// Whether the server supports paging on expansion.
2398    pub paging: Option<super::primitives::Boolean>,
2399    /// Allow request for incomplete expansions?
2400    pub incomplete: Option<super::primitives::Boolean>,
2401    /// Supported expansion parameter.
2402    pub parameter: Vec<TerminologyCapabilitiesExpansionParameter>,
2403    /// Documentation about text searching works.
2404    pub text_filter: Option<super::primitives::Markdown>,
2405}
2406
2407impl super::super::codec::Json for TerminologyCapabilitiesExpansion {
2408    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
2409        let mut object = super::super::codec::Object::new();
2410        if let Some(v) = &self.id {
2411            object.insert(
2412                std::string::String::from("id"),
2413                super::super::codec::Value::String(v.clone()),
2414            );
2415        }
2416        if !self.extension.is_empty() {
2417            let mut items = Vec::with_capacity(self.extension.len());
2418            for item in &self.extension {
2419                items.push(super::super::codec::Value::Object(
2420                    super::super::codec::Json::to_json(item)?,
2421                ));
2422            }
2423            object.insert(
2424                std::string::String::from("extension"),
2425                super::super::codec::Value::Array(items),
2426            );
2427        }
2428        if !self.modifier_extension.is_empty() {
2429            let mut items = Vec::with_capacity(self.modifier_extension.len());
2430            for item in &self.modifier_extension {
2431                items.push(super::super::codec::Value::Object(
2432                    super::super::codec::Json::to_json(item)?,
2433                ));
2434            }
2435            object.insert(
2436                std::string::String::from("modifierExtension"),
2437                super::super::codec::Value::Array(items),
2438            );
2439        }
2440        if let Some(item) = &self.hierarchical {
2441            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
2442                object.insert(std::string::String::from("hierarchical"), v);
2443            }
2444            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
2445                object.insert(std::string::String::from("_hierarchical"), e);
2446            }
2447        }
2448        if let Some(item) = &self.paging {
2449            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
2450                object.insert(std::string::String::from("paging"), v);
2451            }
2452            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
2453                object.insert(std::string::String::from("_paging"), e);
2454            }
2455        }
2456        if let Some(item) = &self.incomplete {
2457            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
2458                object.insert(std::string::String::from("incomplete"), v);
2459            }
2460            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
2461                object.insert(std::string::String::from("_incomplete"), e);
2462            }
2463        }
2464        if !self.parameter.is_empty() {
2465            let mut items = Vec::with_capacity(self.parameter.len());
2466            for item in &self.parameter {
2467                items.push(super::super::codec::Value::Object(
2468                    super::super::codec::Json::to_json(item)?,
2469                ));
2470            }
2471            object.insert(
2472                std::string::String::from("parameter"),
2473                super::super::codec::Value::Array(items),
2474            );
2475        }
2476        if let Some(item) = &self.text_filter {
2477            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
2478                object.insert(std::string::String::from("textFilter"), v);
2479            }
2480            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
2481                object.insert(std::string::String::from("_textFilter"), e);
2482            }
2483        }
2484        Ok(object)
2485    }
2486
2487    fn from_json(
2488        object: &super::super::codec::Object,
2489        path: &mut super::super::codec::Path,
2490    ) -> Result<Self, super::super::codec::DecodeError> {
2491        let mut raw_id: Option<&super::super::codec::Value> = None;
2492        let mut raw_extension: Option<&super::super::codec::Value> = None;
2493        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
2494        let mut raw_hierarchical: Option<&super::super::codec::Value> = None;
2495        let mut raw_hierarchical_element: Option<&super::super::codec::Value> = None;
2496        let mut raw_paging: Option<&super::super::codec::Value> = None;
2497        let mut raw_paging_element: Option<&super::super::codec::Value> = None;
2498        let mut raw_incomplete: Option<&super::super::codec::Value> = None;
2499        let mut raw_incomplete_element: Option<&super::super::codec::Value> = None;
2500        let mut raw_parameter: Option<&super::super::codec::Value> = None;
2501        let mut raw_text_filter: Option<&super::super::codec::Value> = None;
2502        let mut raw_text_filter_element: Option<&super::super::codec::Value> = None;
2503        for (key, value) in object {
2504            match key.as_str() {
2505                "id" => {
2506                    raw_id = Some(value);
2507                }
2508                "extension" => {
2509                    raw_extension = Some(value);
2510                }
2511                "modifierExtension" => {
2512                    raw_modifier_extension = Some(value);
2513                }
2514                "hierarchical" => {
2515                    raw_hierarchical = Some(value);
2516                }
2517                "_hierarchical" => {
2518                    raw_hierarchical_element = Some(value);
2519                }
2520                "paging" => {
2521                    raw_paging = Some(value);
2522                }
2523                "_paging" => {
2524                    raw_paging_element = Some(value);
2525                }
2526                "incomplete" => {
2527                    raw_incomplete = Some(value);
2528                }
2529                "_incomplete" => {
2530                    raw_incomplete_element = Some(value);
2531                }
2532                "parameter" => {
2533                    raw_parameter = Some(value);
2534                }
2535                "textFilter" => {
2536                    raw_text_filter = Some(value);
2537                }
2538                "_textFilter" => {
2539                    raw_text_filter_element = Some(value);
2540                }
2541                other => {
2542                    return path.with(other, |path| {
2543                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
2544                    });
2545                }
2546            }
2547        }
2548        let field_id = raw_id
2549            .map(|value| {
2550                path.with("id", |path| {
2551                    let value = super::super::codec::expect_single(value, path)?;
2552                    super::primitives::checked_string(
2553                        super::super::codec::expect_string(value, path)?,
2554                        path,
2555                    )
2556                })
2557            })
2558            .transpose()?;
2559        let mut field_extension = Vec::new();
2560        if let Some(raw) = raw_extension {
2561            for (index, value) in path
2562                .with("extension", |path| {
2563                    super::super::codec::expect_array(raw, path)
2564                })?
2565                .iter()
2566                .enumerate()
2567            {
2568                field_extension.push(path.with_index("extension", index, |path| {
2569                    super::super::codec::Json::from_json(
2570                        super::super::codec::expect_object(value, path)?,
2571                        path,
2572                    )
2573                })?);
2574            }
2575        }
2576        let mut field_modifier_extension = Vec::new();
2577        if let Some(raw) = raw_modifier_extension {
2578            for (index, value) in path
2579                .with("modifierExtension", |path| {
2580                    super::super::codec::expect_array(raw, path)
2581                })?
2582                .iter()
2583                .enumerate()
2584            {
2585                field_modifier_extension.push(path.with_index(
2586                    "modifierExtension",
2587                    index,
2588                    |path| {
2589                        super::super::codec::Json::from_json(
2590                            super::super::codec::expect_object(value, path)?,
2591                            path,
2592                        )
2593                    },
2594                )?);
2595            }
2596        }
2597        let field_hierarchical = match (raw_hierarchical, raw_hierarchical_element) {
2598            (None, None) => None,
2599            (value, element) => Some(path.with("hierarchical", |path| {
2600                super::super::codec::Primitive::from_json_parts(value, element, path)
2601            })?),
2602        };
2603        let field_paging = match (raw_paging, raw_paging_element) {
2604            (None, None) => None,
2605            (value, element) => Some(path.with("paging", |path| {
2606                super::super::codec::Primitive::from_json_parts(value, element, path)
2607            })?),
2608        };
2609        let field_incomplete = match (raw_incomplete, raw_incomplete_element) {
2610            (None, None) => None,
2611            (value, element) => Some(path.with("incomplete", |path| {
2612                super::super::codec::Primitive::from_json_parts(value, element, path)
2613            })?),
2614        };
2615        let mut field_parameter = Vec::new();
2616        if let Some(raw) = raw_parameter {
2617            for (index, value) in path
2618                .with("parameter", |path| {
2619                    super::super::codec::expect_array(raw, path)
2620                })?
2621                .iter()
2622                .enumerate()
2623            {
2624                field_parameter.push(path.with_index("parameter", index, |path| {
2625                    super::super::codec::Json::from_json(
2626                        super::super::codec::expect_object(value, path)?,
2627                        path,
2628                    )
2629                })?);
2630            }
2631        }
2632        let field_text_filter = match (raw_text_filter, raw_text_filter_element) {
2633            (None, None) => None,
2634            (value, element) => Some(path.with("textFilter", |path| {
2635                super::super::codec::Primitive::from_json_parts(value, element, path)
2636            })?),
2637        };
2638        Ok(Self {
2639            id: field_id,
2640            extension: field_extension,
2641            modifier_extension: field_modifier_extension,
2642            hierarchical: field_hierarchical,
2643            paging: field_paging,
2644            incomplete: field_incomplete,
2645            parameter: field_parameter,
2646            text_filter: field_text_filter,
2647        })
2648    }
2649}
2650
2651impl serde::Serialize for TerminologyCapabilitiesExpansion {
2652    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
2653        let mut map = serde::Serializer::serialize_map(serializer, None)?;
2654        if let Some(item) = &self.hierarchical {
2655            super::super::codec::element_entry(&mut map, "_hierarchical", item)?;
2656        }
2657        if let Some(item) = &self.incomplete {
2658            super::super::codec::element_entry(&mut map, "_incomplete", item)?;
2659        }
2660        if let Some(item) = &self.paging {
2661            super::super::codec::element_entry(&mut map, "_paging", item)?;
2662        }
2663        if let Some(item) = &self.text_filter {
2664            super::super::codec::element_entry(&mut map, "_textFilter", item)?;
2665        }
2666        if !self.extension.is_empty() {
2667            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
2668        }
2669        if let Some(item) = &self.hierarchical {
2670            super::super::codec::value_entry(&mut map, "hierarchical", item)?;
2671        }
2672        if let Some(v) = &self.id {
2673            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
2674        }
2675        if let Some(item) = &self.incomplete {
2676            super::super::codec::value_entry(&mut map, "incomplete", item)?;
2677        }
2678        if !self.modifier_extension.is_empty() {
2679            serde::ser::SerializeMap::serialize_entry(
2680                &mut map,
2681                "modifierExtension",
2682                &self.modifier_extension,
2683            )?;
2684        }
2685        if let Some(item) = &self.paging {
2686            super::super::codec::value_entry(&mut map, "paging", item)?;
2687        }
2688        if !self.parameter.is_empty() {
2689            serde::ser::SerializeMap::serialize_entry(&mut map, "parameter", &self.parameter)?;
2690        }
2691        if let Some(item) = &self.text_filter {
2692            super::super::codec::value_entry(&mut map, "textFilter", item)?;
2693        }
2694        serde::ser::SerializeMap::end(map)
2695    }
2696}
2697
2698impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesExpansion {
2699    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2700        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
2701        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesExpansion");
2702        let object =
2703            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
2704        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
2705    }
2706}
2707
2708/// Supported expansion parameter.
2709#[derive(Debug, Clone, Default, PartialEq, Eq)]
2710pub struct TerminologyCapabilitiesExpansionParameter {
2711    /// Unique id for inter-element referencing
2712    ///
2713    /// Unique id for the element within a resource (for internal references). This
2714    /// may be any string value that does not contain spaces.
2715    pub id: Option<std::string::String>,
2716    /// Additional content defined by implementations
2717    ///
2718    /// May be used to represent additional information that is not part of the
2719    /// basic definition of the element. To make the use of extensions safe and
2720    /// manageable, there is a strict set of governance applied to the definition
2721    /// and use of extensions. Though any implementer can define an extension, there
2722    /// is a set of requirements that SHALL be met as part of the definition of the
2723    /// extension.
2724    pub extension: Vec<super::extension::Extension>,
2725    /// Extensions that cannot be ignored even if unrecognized
2726    ///
2727    /// May be used to represent additional information that is not part of the
2728    /// basic definition of the element and that modifies the understanding of the
2729    /// element in which it is contained and/or the understanding of the containing
2730    /// element's descendants. Usually modifier elements provide negation or
2731    /// qualification. To make the use of extensions safe and manageable, there is a
2732    /// strict set of governance applied to the definition and use of extensions.
2733    /// Though any implementer can define an extension, there is a set of
2734    /// requirements that SHALL be met as part of the definition of the extension.
2735    /// Applications processing a resource are required to check for modifier
2736    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
2737    /// on Resource or DomainResource (including cannot change the meaning of
2738    /// modifierExtension itself).
2739    pub modifier_extension: Vec<super::extension::Extension>,
2740    /// Expansion Parameter name.
2741    pub name: super::primitives::Code,
2742    /// Description of support for parameter.
2743    pub documentation: Option<super::primitives::String>,
2744}
2745
2746impl super::super::codec::Json for TerminologyCapabilitiesExpansionParameter {
2747    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
2748        let mut object = super::super::codec::Object::new();
2749        if let Some(v) = &self.id {
2750            object.insert(
2751                std::string::String::from("id"),
2752                super::super::codec::Value::String(v.clone()),
2753            );
2754        }
2755        if !self.extension.is_empty() {
2756            let mut items = Vec::with_capacity(self.extension.len());
2757            for item in &self.extension {
2758                items.push(super::super::codec::Value::Object(
2759                    super::super::codec::Json::to_json(item)?,
2760                ));
2761            }
2762            object.insert(
2763                std::string::String::from("extension"),
2764                super::super::codec::Value::Array(items),
2765            );
2766        }
2767        if !self.modifier_extension.is_empty() {
2768            let mut items = Vec::with_capacity(self.modifier_extension.len());
2769            for item in &self.modifier_extension {
2770                items.push(super::super::codec::Value::Object(
2771                    super::super::codec::Json::to_json(item)?,
2772                ));
2773            }
2774            object.insert(
2775                std::string::String::from("modifierExtension"),
2776                super::super::codec::Value::Array(items),
2777            );
2778        }
2779        if let Some(v) = super::super::codec::Primitive::value_json(&self.name)? {
2780            object.insert(std::string::String::from("name"), v);
2781        }
2782        if let Some(e) = super::super::codec::Primitive::element_json(&self.name)? {
2783            object.insert(std::string::String::from("_name"), e);
2784        }
2785        if let Some(item) = &self.documentation {
2786            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
2787                object.insert(std::string::String::from("documentation"), v);
2788            }
2789            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
2790                object.insert(std::string::String::from("_documentation"), e);
2791            }
2792        }
2793        Ok(object)
2794    }
2795
2796    fn from_json(
2797        object: &super::super::codec::Object,
2798        path: &mut super::super::codec::Path,
2799    ) -> Result<Self, super::super::codec::DecodeError> {
2800        let mut raw_id: Option<&super::super::codec::Value> = None;
2801        let mut raw_extension: Option<&super::super::codec::Value> = None;
2802        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
2803        let mut raw_name: Option<&super::super::codec::Value> = None;
2804        let mut raw_name_element: Option<&super::super::codec::Value> = None;
2805        let mut raw_documentation: Option<&super::super::codec::Value> = None;
2806        let mut raw_documentation_element: Option<&super::super::codec::Value> = None;
2807        for (key, value) in object {
2808            match key.as_str() {
2809                "id" => {
2810                    raw_id = Some(value);
2811                }
2812                "extension" => {
2813                    raw_extension = Some(value);
2814                }
2815                "modifierExtension" => {
2816                    raw_modifier_extension = Some(value);
2817                }
2818                "name" => {
2819                    raw_name = Some(value);
2820                }
2821                "_name" => {
2822                    raw_name_element = Some(value);
2823                }
2824                "documentation" => {
2825                    raw_documentation = Some(value);
2826                }
2827                "_documentation" => {
2828                    raw_documentation_element = Some(value);
2829                }
2830                other => {
2831                    return path.with(other, |path| {
2832                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
2833                    });
2834                }
2835            }
2836        }
2837        let field_id = raw_id
2838            .map(|value| {
2839                path.with("id", |path| {
2840                    let value = super::super::codec::expect_single(value, path)?;
2841                    super::primitives::checked_string(
2842                        super::super::codec::expect_string(value, path)?,
2843                        path,
2844                    )
2845                })
2846            })
2847            .transpose()?;
2848        let mut field_extension = Vec::new();
2849        if let Some(raw) = raw_extension {
2850            for (index, value) in path
2851                .with("extension", |path| {
2852                    super::super::codec::expect_array(raw, path)
2853                })?
2854                .iter()
2855                .enumerate()
2856            {
2857                field_extension.push(path.with_index("extension", index, |path| {
2858                    super::super::codec::Json::from_json(
2859                        super::super::codec::expect_object(value, path)?,
2860                        path,
2861                    )
2862                })?);
2863            }
2864        }
2865        let mut field_modifier_extension = Vec::new();
2866        if let Some(raw) = raw_modifier_extension {
2867            for (index, value) in path
2868                .with("modifierExtension", |path| {
2869                    super::super::codec::expect_array(raw, path)
2870                })?
2871                .iter()
2872                .enumerate()
2873            {
2874                field_modifier_extension.push(path.with_index(
2875                    "modifierExtension",
2876                    index,
2877                    |path| {
2878                        super::super::codec::Json::from_json(
2879                            super::super::codec::expect_object(value, path)?,
2880                            path,
2881                        )
2882                    },
2883                )?);
2884            }
2885        }
2886        let field_name = path.with("name", |path| {
2887            super::super::codec::Primitive::from_json_parts(raw_name, raw_name_element, path)
2888        })?;
2889        let field_documentation = match (raw_documentation, raw_documentation_element) {
2890            (None, None) => None,
2891            (value, element) => Some(path.with("documentation", |path| {
2892                super::super::codec::Primitive::from_json_parts(value, element, path)
2893            })?),
2894        };
2895        Ok(Self {
2896            id: field_id,
2897            extension: field_extension,
2898            modifier_extension: field_modifier_extension,
2899            name: field_name,
2900            documentation: field_documentation,
2901        })
2902    }
2903}
2904
2905impl serde::Serialize for TerminologyCapabilitiesExpansionParameter {
2906    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
2907        let mut map = serde::Serializer::serialize_map(serializer, None)?;
2908        if let Some(item) = &self.documentation {
2909            super::super::codec::element_entry(&mut map, "_documentation", item)?;
2910        }
2911        super::super::codec::element_entry(&mut map, "_name", &self.name)?;
2912        if let Some(item) = &self.documentation {
2913            super::super::codec::value_entry(&mut map, "documentation", item)?;
2914        }
2915        if !self.extension.is_empty() {
2916            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
2917        }
2918        if let Some(v) = &self.id {
2919            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
2920        }
2921        if !self.modifier_extension.is_empty() {
2922            serde::ser::SerializeMap::serialize_entry(
2923                &mut map,
2924                "modifierExtension",
2925                &self.modifier_extension,
2926            )?;
2927        }
2928        super::super::codec::value_entry(&mut map, "name", &self.name)?;
2929        serde::ser::SerializeMap::end(map)
2930    }
2931}
2932
2933impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesExpansionParameter {
2934    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2935        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
2936        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesExpansionParameter");
2937        let object =
2938            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
2939        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
2940    }
2941}
2942
2943/// If this describes a specific instance
2944///
2945/// Identifies a specific implementation instance that is described by the
2946/// terminology capability statement - i.e. a particular installation, rather
2947/// than the capabilities of a software program.
2948#[derive(Debug, Clone, Default, PartialEq, Eq)]
2949pub struct TerminologyCapabilitiesImplementation {
2950    /// Unique id for inter-element referencing
2951    ///
2952    /// Unique id for the element within a resource (for internal references). This
2953    /// may be any string value that does not contain spaces.
2954    pub id: Option<std::string::String>,
2955    /// Additional content defined by implementations
2956    ///
2957    /// May be used to represent additional information that is not part of the
2958    /// basic definition of the element. To make the use of extensions safe and
2959    /// manageable, there is a strict set of governance applied to the definition
2960    /// and use of extensions. Though any implementer can define an extension, there
2961    /// is a set of requirements that SHALL be met as part of the definition of the
2962    /// extension.
2963    pub extension: Vec<super::extension::Extension>,
2964    /// Extensions that cannot be ignored even if unrecognized
2965    ///
2966    /// May be used to represent additional information that is not part of the
2967    /// basic definition of the element and that modifies the understanding of the
2968    /// element in which it is contained and/or the understanding of the containing
2969    /// element's descendants. Usually modifier elements provide negation or
2970    /// qualification. To make the use of extensions safe and manageable, there is a
2971    /// strict set of governance applied to the definition and use of extensions.
2972    /// Though any implementer can define an extension, there is a set of
2973    /// requirements that SHALL be met as part of the definition of the extension.
2974    /// Applications processing a resource are required to check for modifier
2975    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
2976    /// on Resource or DomainResource (including cannot change the meaning of
2977    /// modifierExtension itself).
2978    pub modifier_extension: Vec<super::extension::Extension>,
2979    /// Describes this specific instance
2980    ///
2981    /// Information about the specific installation that this terminology capability
2982    /// statement relates to.
2983    pub description: super::primitives::String,
2984    /// Base URL for the implementation
2985    ///
2986    /// An absolute base URL for the implementation.
2987    pub url: Option<super::primitives::Url>,
2988}
2989
2990impl super::super::codec::Json for TerminologyCapabilitiesImplementation {
2991    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
2992        let mut object = super::super::codec::Object::new();
2993        if let Some(v) = &self.id {
2994            object.insert(
2995                std::string::String::from("id"),
2996                super::super::codec::Value::String(v.clone()),
2997            );
2998        }
2999        if !self.extension.is_empty() {
3000            let mut items = Vec::with_capacity(self.extension.len());
3001            for item in &self.extension {
3002                items.push(super::super::codec::Value::Object(
3003                    super::super::codec::Json::to_json(item)?,
3004                ));
3005            }
3006            object.insert(
3007                std::string::String::from("extension"),
3008                super::super::codec::Value::Array(items),
3009            );
3010        }
3011        if !self.modifier_extension.is_empty() {
3012            let mut items = Vec::with_capacity(self.modifier_extension.len());
3013            for item in &self.modifier_extension {
3014                items.push(super::super::codec::Value::Object(
3015                    super::super::codec::Json::to_json(item)?,
3016                ));
3017            }
3018            object.insert(
3019                std::string::String::from("modifierExtension"),
3020                super::super::codec::Value::Array(items),
3021            );
3022        }
3023        if let Some(v) = super::super::codec::Primitive::value_json(&self.description)? {
3024            object.insert(std::string::String::from("description"), v);
3025        }
3026        if let Some(e) = super::super::codec::Primitive::element_json(&self.description)? {
3027            object.insert(std::string::String::from("_description"), e);
3028        }
3029        if let Some(item) = &self.url {
3030            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
3031                object.insert(std::string::String::from("url"), v);
3032            }
3033            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
3034                object.insert(std::string::String::from("_url"), e);
3035            }
3036        }
3037        Ok(object)
3038    }
3039
3040    fn from_json(
3041        object: &super::super::codec::Object,
3042        path: &mut super::super::codec::Path,
3043    ) -> Result<Self, super::super::codec::DecodeError> {
3044        let mut raw_id: Option<&super::super::codec::Value> = None;
3045        let mut raw_extension: Option<&super::super::codec::Value> = None;
3046        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
3047        let mut raw_description: Option<&super::super::codec::Value> = None;
3048        let mut raw_description_element: Option<&super::super::codec::Value> = None;
3049        let mut raw_url: Option<&super::super::codec::Value> = None;
3050        let mut raw_url_element: Option<&super::super::codec::Value> = None;
3051        for (key, value) in object {
3052            match key.as_str() {
3053                "id" => {
3054                    raw_id = Some(value);
3055                }
3056                "extension" => {
3057                    raw_extension = Some(value);
3058                }
3059                "modifierExtension" => {
3060                    raw_modifier_extension = Some(value);
3061                }
3062                "description" => {
3063                    raw_description = Some(value);
3064                }
3065                "_description" => {
3066                    raw_description_element = Some(value);
3067                }
3068                "url" => {
3069                    raw_url = Some(value);
3070                }
3071                "_url" => {
3072                    raw_url_element = Some(value);
3073                }
3074                other => {
3075                    return path.with(other, |path| {
3076                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
3077                    });
3078                }
3079            }
3080        }
3081        let field_id = raw_id
3082            .map(|value| {
3083                path.with("id", |path| {
3084                    let value = super::super::codec::expect_single(value, path)?;
3085                    super::primitives::checked_string(
3086                        super::super::codec::expect_string(value, path)?,
3087                        path,
3088                    )
3089                })
3090            })
3091            .transpose()?;
3092        let mut field_extension = Vec::new();
3093        if let Some(raw) = raw_extension {
3094            for (index, value) in path
3095                .with("extension", |path| {
3096                    super::super::codec::expect_array(raw, path)
3097                })?
3098                .iter()
3099                .enumerate()
3100            {
3101                field_extension.push(path.with_index("extension", index, |path| {
3102                    super::super::codec::Json::from_json(
3103                        super::super::codec::expect_object(value, path)?,
3104                        path,
3105                    )
3106                })?);
3107            }
3108        }
3109        let mut field_modifier_extension = Vec::new();
3110        if let Some(raw) = raw_modifier_extension {
3111            for (index, value) in path
3112                .with("modifierExtension", |path| {
3113                    super::super::codec::expect_array(raw, path)
3114                })?
3115                .iter()
3116                .enumerate()
3117            {
3118                field_modifier_extension.push(path.with_index(
3119                    "modifierExtension",
3120                    index,
3121                    |path| {
3122                        super::super::codec::Json::from_json(
3123                            super::super::codec::expect_object(value, path)?,
3124                            path,
3125                        )
3126                    },
3127                )?);
3128            }
3129        }
3130        let field_description = path.with("description", |path| {
3131            super::super::codec::Primitive::from_json_parts(
3132                raw_description,
3133                raw_description_element,
3134                path,
3135            )
3136        })?;
3137        let field_url = match (raw_url, raw_url_element) {
3138            (None, None) => None,
3139            (value, element) => Some(path.with("url", |path| {
3140                super::super::codec::Primitive::from_json_parts(value, element, path)
3141            })?),
3142        };
3143        Ok(Self {
3144            id: field_id,
3145            extension: field_extension,
3146            modifier_extension: field_modifier_extension,
3147            description: field_description,
3148            url: field_url,
3149        })
3150    }
3151}
3152
3153impl serde::Serialize for TerminologyCapabilitiesImplementation {
3154    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3155        let mut map = serde::Serializer::serialize_map(serializer, None)?;
3156        super::super::codec::element_entry(&mut map, "_description", &self.description)?;
3157        if let Some(item) = &self.url {
3158            super::super::codec::element_entry(&mut map, "_url", item)?;
3159        }
3160        super::super::codec::value_entry(&mut map, "description", &self.description)?;
3161        if !self.extension.is_empty() {
3162            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
3163        }
3164        if let Some(v) = &self.id {
3165            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
3166        }
3167        if !self.modifier_extension.is_empty() {
3168            serde::ser::SerializeMap::serialize_entry(
3169                &mut map,
3170                "modifierExtension",
3171                &self.modifier_extension,
3172            )?;
3173        }
3174        if let Some(item) = &self.url {
3175            super::super::codec::value_entry(&mut map, "url", item)?;
3176        }
3177        serde::ser::SerializeMap::end(map)
3178    }
3179}
3180
3181impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesImplementation {
3182    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3183        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
3184        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesImplementation");
3185        let object =
3186            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
3187        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
3188    }
3189}
3190
3191/// Software that is covered by this terminology capability statement
3192///
3193/// Software that is covered by this terminology capability statement. It is
3194/// used when the statement describes the capabilities of a particular software
3195/// version, independent of an installation.
3196#[derive(Debug, Clone, Default, PartialEq, Eq)]
3197pub struct TerminologyCapabilitiesSoftware {
3198    /// Unique id for inter-element referencing
3199    ///
3200    /// Unique id for the element within a resource (for internal references). This
3201    /// may be any string value that does not contain spaces.
3202    pub id: Option<std::string::String>,
3203    /// Additional content defined by implementations
3204    ///
3205    /// May be used to represent additional information that is not part of the
3206    /// basic definition of the element. To make the use of extensions safe and
3207    /// manageable, there is a strict set of governance applied to the definition
3208    /// and use of extensions. Though any implementer can define an extension, there
3209    /// is a set of requirements that SHALL be met as part of the definition of the
3210    /// extension.
3211    pub extension: Vec<super::extension::Extension>,
3212    /// Extensions that cannot be ignored even if unrecognized
3213    ///
3214    /// May be used to represent additional information that is not part of the
3215    /// basic definition of the element and that modifies the understanding of the
3216    /// element in which it is contained and/or the understanding of the containing
3217    /// element's descendants. Usually modifier elements provide negation or
3218    /// qualification. To make the use of extensions safe and manageable, there is a
3219    /// strict set of governance applied to the definition and use of extensions.
3220    /// Though any implementer can define an extension, there is a set of
3221    /// requirements that SHALL be met as part of the definition of the extension.
3222    /// Applications processing a resource are required to check for modifier
3223    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
3224    /// on Resource or DomainResource (including cannot change the meaning of
3225    /// modifierExtension itself).
3226    pub modifier_extension: Vec<super::extension::Extension>,
3227    /// A name the software is known by
3228    ///
3229    /// Name the software is known by.
3230    pub name: super::primitives::String,
3231    /// Version covered by this statement
3232    ///
3233    /// The version identifier for the software covered by this statement.
3234    pub version: Option<super::primitives::String>,
3235}
3236
3237impl super::super::codec::Json for TerminologyCapabilitiesSoftware {
3238    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
3239        let mut object = super::super::codec::Object::new();
3240        if let Some(v) = &self.id {
3241            object.insert(
3242                std::string::String::from("id"),
3243                super::super::codec::Value::String(v.clone()),
3244            );
3245        }
3246        if !self.extension.is_empty() {
3247            let mut items = Vec::with_capacity(self.extension.len());
3248            for item in &self.extension {
3249                items.push(super::super::codec::Value::Object(
3250                    super::super::codec::Json::to_json(item)?,
3251                ));
3252            }
3253            object.insert(
3254                std::string::String::from("extension"),
3255                super::super::codec::Value::Array(items),
3256            );
3257        }
3258        if !self.modifier_extension.is_empty() {
3259            let mut items = Vec::with_capacity(self.modifier_extension.len());
3260            for item in &self.modifier_extension {
3261                items.push(super::super::codec::Value::Object(
3262                    super::super::codec::Json::to_json(item)?,
3263                ));
3264            }
3265            object.insert(
3266                std::string::String::from("modifierExtension"),
3267                super::super::codec::Value::Array(items),
3268            );
3269        }
3270        if let Some(v) = super::super::codec::Primitive::value_json(&self.name)? {
3271            object.insert(std::string::String::from("name"), v);
3272        }
3273        if let Some(e) = super::super::codec::Primitive::element_json(&self.name)? {
3274            object.insert(std::string::String::from("_name"), e);
3275        }
3276        if let Some(item) = &self.version {
3277            if let Some(v) = super::super::codec::Primitive::value_json(item)? {
3278                object.insert(std::string::String::from("version"), v);
3279            }
3280            if let Some(e) = super::super::codec::Primitive::element_json(item)? {
3281                object.insert(std::string::String::from("_version"), e);
3282            }
3283        }
3284        Ok(object)
3285    }
3286
3287    fn from_json(
3288        object: &super::super::codec::Object,
3289        path: &mut super::super::codec::Path,
3290    ) -> Result<Self, super::super::codec::DecodeError> {
3291        let mut raw_id: Option<&super::super::codec::Value> = None;
3292        let mut raw_extension: Option<&super::super::codec::Value> = None;
3293        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
3294        let mut raw_name: Option<&super::super::codec::Value> = None;
3295        let mut raw_name_element: Option<&super::super::codec::Value> = None;
3296        let mut raw_version: Option<&super::super::codec::Value> = None;
3297        let mut raw_version_element: Option<&super::super::codec::Value> = None;
3298        for (key, value) in object {
3299            match key.as_str() {
3300                "id" => {
3301                    raw_id = Some(value);
3302                }
3303                "extension" => {
3304                    raw_extension = Some(value);
3305                }
3306                "modifierExtension" => {
3307                    raw_modifier_extension = Some(value);
3308                }
3309                "name" => {
3310                    raw_name = Some(value);
3311                }
3312                "_name" => {
3313                    raw_name_element = Some(value);
3314                }
3315                "version" => {
3316                    raw_version = Some(value);
3317                }
3318                "_version" => {
3319                    raw_version_element = Some(value);
3320                }
3321                other => {
3322                    return path.with(other, |path| {
3323                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
3324                    });
3325                }
3326            }
3327        }
3328        let field_id = raw_id
3329            .map(|value| {
3330                path.with("id", |path| {
3331                    let value = super::super::codec::expect_single(value, path)?;
3332                    super::primitives::checked_string(
3333                        super::super::codec::expect_string(value, path)?,
3334                        path,
3335                    )
3336                })
3337            })
3338            .transpose()?;
3339        let mut field_extension = Vec::new();
3340        if let Some(raw) = raw_extension {
3341            for (index, value) in path
3342                .with("extension", |path| {
3343                    super::super::codec::expect_array(raw, path)
3344                })?
3345                .iter()
3346                .enumerate()
3347            {
3348                field_extension.push(path.with_index("extension", index, |path| {
3349                    super::super::codec::Json::from_json(
3350                        super::super::codec::expect_object(value, path)?,
3351                        path,
3352                    )
3353                })?);
3354            }
3355        }
3356        let mut field_modifier_extension = Vec::new();
3357        if let Some(raw) = raw_modifier_extension {
3358            for (index, value) in path
3359                .with("modifierExtension", |path| {
3360                    super::super::codec::expect_array(raw, path)
3361                })?
3362                .iter()
3363                .enumerate()
3364            {
3365                field_modifier_extension.push(path.with_index(
3366                    "modifierExtension",
3367                    index,
3368                    |path| {
3369                        super::super::codec::Json::from_json(
3370                            super::super::codec::expect_object(value, path)?,
3371                            path,
3372                        )
3373                    },
3374                )?);
3375            }
3376        }
3377        let field_name = path.with("name", |path| {
3378            super::super::codec::Primitive::from_json_parts(raw_name, raw_name_element, path)
3379        })?;
3380        let field_version = match (raw_version, raw_version_element) {
3381            (None, None) => None,
3382            (value, element) => Some(path.with("version", |path| {
3383                super::super::codec::Primitive::from_json_parts(value, element, path)
3384            })?),
3385        };
3386        Ok(Self {
3387            id: field_id,
3388            extension: field_extension,
3389            modifier_extension: field_modifier_extension,
3390            name: field_name,
3391            version: field_version,
3392        })
3393    }
3394}
3395
3396impl serde::Serialize for TerminologyCapabilitiesSoftware {
3397    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3398        let mut map = serde::Serializer::serialize_map(serializer, None)?;
3399        super::super::codec::element_entry(&mut map, "_name", &self.name)?;
3400        if let Some(item) = &self.version {
3401            super::super::codec::element_entry(&mut map, "_version", item)?;
3402        }
3403        if !self.extension.is_empty() {
3404            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
3405        }
3406        if let Some(v) = &self.id {
3407            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
3408        }
3409        if !self.modifier_extension.is_empty() {
3410            serde::ser::SerializeMap::serialize_entry(
3411                &mut map,
3412                "modifierExtension",
3413                &self.modifier_extension,
3414            )?;
3415        }
3416        super::super::codec::value_entry(&mut map, "name", &self.name)?;
3417        if let Some(item) = &self.version {
3418            super::super::codec::value_entry(&mut map, "version", item)?;
3419        }
3420        serde::ser::SerializeMap::end(map)
3421    }
3422}
3423
3424impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesSoftware {
3425    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3426        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
3427        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesSoftware");
3428        let object =
3429            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
3430        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
3431    }
3432}
3433
3434/// Information about the
3435/// \[ConceptMap/$translate\](conceptmap-operation-translate.html) operation.
3436#[derive(Debug, Clone, Default, PartialEq, Eq)]
3437pub struct TerminologyCapabilitiesTranslation {
3438    /// Unique id for inter-element referencing
3439    ///
3440    /// Unique id for the element within a resource (for internal references). This
3441    /// may be any string value that does not contain spaces.
3442    pub id: Option<std::string::String>,
3443    /// Additional content defined by implementations
3444    ///
3445    /// May be used to represent additional information that is not part of the
3446    /// basic definition of the element. To make the use of extensions safe and
3447    /// manageable, there is a strict set of governance applied to the definition
3448    /// and use of extensions. Though any implementer can define an extension, there
3449    /// is a set of requirements that SHALL be met as part of the definition of the
3450    /// extension.
3451    pub extension: Vec<super::extension::Extension>,
3452    /// Extensions that cannot be ignored even if unrecognized
3453    ///
3454    /// May be used to represent additional information that is not part of the
3455    /// basic definition of the element and that modifies the understanding of the
3456    /// element in which it is contained and/or the understanding of the containing
3457    /// element's descendants. Usually modifier elements provide negation or
3458    /// qualification. To make the use of extensions safe and manageable, there is a
3459    /// strict set of governance applied to the definition and use of extensions.
3460    /// Though any implementer can define an extension, there is a set of
3461    /// requirements that SHALL be met as part of the definition of the extension.
3462    /// Applications processing a resource are required to check for modifier
3463    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
3464    /// on Resource or DomainResource (including cannot change the meaning of
3465    /// modifierExtension itself).
3466    pub modifier_extension: Vec<super::extension::Extension>,
3467    /// Whether the client must identify the map.
3468    pub needs_map: super::primitives::Boolean,
3469}
3470
3471impl super::super::codec::Json for TerminologyCapabilitiesTranslation {
3472    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
3473        let mut object = super::super::codec::Object::new();
3474        if let Some(v) = &self.id {
3475            object.insert(
3476                std::string::String::from("id"),
3477                super::super::codec::Value::String(v.clone()),
3478            );
3479        }
3480        if !self.extension.is_empty() {
3481            let mut items = Vec::with_capacity(self.extension.len());
3482            for item in &self.extension {
3483                items.push(super::super::codec::Value::Object(
3484                    super::super::codec::Json::to_json(item)?,
3485                ));
3486            }
3487            object.insert(
3488                std::string::String::from("extension"),
3489                super::super::codec::Value::Array(items),
3490            );
3491        }
3492        if !self.modifier_extension.is_empty() {
3493            let mut items = Vec::with_capacity(self.modifier_extension.len());
3494            for item in &self.modifier_extension {
3495                items.push(super::super::codec::Value::Object(
3496                    super::super::codec::Json::to_json(item)?,
3497                ));
3498            }
3499            object.insert(
3500                std::string::String::from("modifierExtension"),
3501                super::super::codec::Value::Array(items),
3502            );
3503        }
3504        if let Some(v) = super::super::codec::Primitive::value_json(&self.needs_map)? {
3505            object.insert(std::string::String::from("needsMap"), v);
3506        }
3507        if let Some(e) = super::super::codec::Primitive::element_json(&self.needs_map)? {
3508            object.insert(std::string::String::from("_needsMap"), e);
3509        }
3510        Ok(object)
3511    }
3512
3513    fn from_json(
3514        object: &super::super::codec::Object,
3515        path: &mut super::super::codec::Path,
3516    ) -> Result<Self, super::super::codec::DecodeError> {
3517        let mut raw_id: Option<&super::super::codec::Value> = None;
3518        let mut raw_extension: Option<&super::super::codec::Value> = None;
3519        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
3520        let mut raw_needs_map: Option<&super::super::codec::Value> = None;
3521        let mut raw_needs_map_element: Option<&super::super::codec::Value> = None;
3522        for (key, value) in object {
3523            match key.as_str() {
3524                "id" => {
3525                    raw_id = Some(value);
3526                }
3527                "extension" => {
3528                    raw_extension = Some(value);
3529                }
3530                "modifierExtension" => {
3531                    raw_modifier_extension = Some(value);
3532                }
3533                "needsMap" => {
3534                    raw_needs_map = Some(value);
3535                }
3536                "_needsMap" => {
3537                    raw_needs_map_element = Some(value);
3538                }
3539                other => {
3540                    return path.with(other, |path| {
3541                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
3542                    });
3543                }
3544            }
3545        }
3546        let field_id = raw_id
3547            .map(|value| {
3548                path.with("id", |path| {
3549                    let value = super::super::codec::expect_single(value, path)?;
3550                    super::primitives::checked_string(
3551                        super::super::codec::expect_string(value, path)?,
3552                        path,
3553                    )
3554                })
3555            })
3556            .transpose()?;
3557        let mut field_extension = Vec::new();
3558        if let Some(raw) = raw_extension {
3559            for (index, value) in path
3560                .with("extension", |path| {
3561                    super::super::codec::expect_array(raw, path)
3562                })?
3563                .iter()
3564                .enumerate()
3565            {
3566                field_extension.push(path.with_index("extension", index, |path| {
3567                    super::super::codec::Json::from_json(
3568                        super::super::codec::expect_object(value, path)?,
3569                        path,
3570                    )
3571                })?);
3572            }
3573        }
3574        let mut field_modifier_extension = Vec::new();
3575        if let Some(raw) = raw_modifier_extension {
3576            for (index, value) in path
3577                .with("modifierExtension", |path| {
3578                    super::super::codec::expect_array(raw, path)
3579                })?
3580                .iter()
3581                .enumerate()
3582            {
3583                field_modifier_extension.push(path.with_index(
3584                    "modifierExtension",
3585                    index,
3586                    |path| {
3587                        super::super::codec::Json::from_json(
3588                            super::super::codec::expect_object(value, path)?,
3589                            path,
3590                        )
3591                    },
3592                )?);
3593            }
3594        }
3595        let field_needs_map = path.with("needsMap", |path| {
3596            super::super::codec::Primitive::from_json_parts(
3597                raw_needs_map,
3598                raw_needs_map_element,
3599                path,
3600            )
3601        })?;
3602        Ok(Self {
3603            id: field_id,
3604            extension: field_extension,
3605            modifier_extension: field_modifier_extension,
3606            needs_map: field_needs_map,
3607        })
3608    }
3609}
3610
3611impl serde::Serialize for TerminologyCapabilitiesTranslation {
3612    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3613        let mut map = serde::Serializer::serialize_map(serializer, None)?;
3614        super::super::codec::element_entry(&mut map, "_needsMap", &self.needs_map)?;
3615        if !self.extension.is_empty() {
3616            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
3617        }
3618        if let Some(v) = &self.id {
3619            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
3620        }
3621        if !self.modifier_extension.is_empty() {
3622            serde::ser::SerializeMap::serialize_entry(
3623                &mut map,
3624                "modifierExtension",
3625                &self.modifier_extension,
3626            )?;
3627        }
3628        super::super::codec::value_entry(&mut map, "needsMap", &self.needs_map)?;
3629        serde::ser::SerializeMap::end(map)
3630    }
3631}
3632
3633impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesTranslation {
3634    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3635        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
3636        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesTranslation");
3637        let object =
3638            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
3639        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
3640    }
3641}
3642
3643/// Information about the
3644/// \[ValueSet/$validate-code\](valueset-operation-validate-code.html)
3645/// operation.
3646#[derive(Debug, Clone, Default, PartialEq, Eq)]
3647pub struct TerminologyCapabilitiesValidateCode {
3648    /// Unique id for inter-element referencing
3649    ///
3650    /// Unique id for the element within a resource (for internal references). This
3651    /// may be any string value that does not contain spaces.
3652    pub id: Option<std::string::String>,
3653    /// Additional content defined by implementations
3654    ///
3655    /// May be used to represent additional information that is not part of the
3656    /// basic definition of the element. To make the use of extensions safe and
3657    /// manageable, there is a strict set of governance applied to the definition
3658    /// and use of extensions. Though any implementer can define an extension, there
3659    /// is a set of requirements that SHALL be met as part of the definition of the
3660    /// extension.
3661    pub extension: Vec<super::extension::Extension>,
3662    /// Extensions that cannot be ignored even if unrecognized
3663    ///
3664    /// May be used to represent additional information that is not part of the
3665    /// basic definition of the element and that modifies the understanding of the
3666    /// element in which it is contained and/or the understanding of the containing
3667    /// element's descendants. Usually modifier elements provide negation or
3668    /// qualification. To make the use of extensions safe and manageable, there is a
3669    /// strict set of governance applied to the definition and use of extensions.
3670    /// Though any implementer can define an extension, there is a set of
3671    /// requirements that SHALL be met as part of the definition of the extension.
3672    /// Applications processing a resource are required to check for modifier
3673    /// extensions. Modifier extensions SHALL NOT change the meaning of any elements
3674    /// on Resource or DomainResource (including cannot change the meaning of
3675    /// modifierExtension itself).
3676    pub modifier_extension: Vec<super::extension::Extension>,
3677    /// Whether translations are validated.
3678    pub translations: super::primitives::Boolean,
3679}
3680
3681impl super::super::codec::Json for TerminologyCapabilitiesValidateCode {
3682    fn to_json(&self) -> Result<super::super::codec::Object, super::super::codec::EncodeError> {
3683        let mut object = super::super::codec::Object::new();
3684        if let Some(v) = &self.id {
3685            object.insert(
3686                std::string::String::from("id"),
3687                super::super::codec::Value::String(v.clone()),
3688            );
3689        }
3690        if !self.extension.is_empty() {
3691            let mut items = Vec::with_capacity(self.extension.len());
3692            for item in &self.extension {
3693                items.push(super::super::codec::Value::Object(
3694                    super::super::codec::Json::to_json(item)?,
3695                ));
3696            }
3697            object.insert(
3698                std::string::String::from("extension"),
3699                super::super::codec::Value::Array(items),
3700            );
3701        }
3702        if !self.modifier_extension.is_empty() {
3703            let mut items = Vec::with_capacity(self.modifier_extension.len());
3704            for item in &self.modifier_extension {
3705                items.push(super::super::codec::Value::Object(
3706                    super::super::codec::Json::to_json(item)?,
3707                ));
3708            }
3709            object.insert(
3710                std::string::String::from("modifierExtension"),
3711                super::super::codec::Value::Array(items),
3712            );
3713        }
3714        if let Some(v) = super::super::codec::Primitive::value_json(&self.translations)? {
3715            object.insert(std::string::String::from("translations"), v);
3716        }
3717        if let Some(e) = super::super::codec::Primitive::element_json(&self.translations)? {
3718            object.insert(std::string::String::from("_translations"), e);
3719        }
3720        Ok(object)
3721    }
3722
3723    fn from_json(
3724        object: &super::super::codec::Object,
3725        path: &mut super::super::codec::Path,
3726    ) -> Result<Self, super::super::codec::DecodeError> {
3727        let mut raw_id: Option<&super::super::codec::Value> = None;
3728        let mut raw_extension: Option<&super::super::codec::Value> = None;
3729        let mut raw_modifier_extension: Option<&super::super::codec::Value> = None;
3730        let mut raw_translations: Option<&super::super::codec::Value> = None;
3731        let mut raw_translations_element: Option<&super::super::codec::Value> = None;
3732        for (key, value) in object {
3733            match key.as_str() {
3734                "id" => {
3735                    raw_id = Some(value);
3736                }
3737                "extension" => {
3738                    raw_extension = Some(value);
3739                }
3740                "modifierExtension" => {
3741                    raw_modifier_extension = Some(value);
3742                }
3743                "translations" => {
3744                    raw_translations = Some(value);
3745                }
3746                "_translations" => {
3747                    raw_translations_element = Some(value);
3748                }
3749                other => {
3750                    return path.with(other, |path| {
3751                        Err(path.error(super::super::codec::DecodeErrorKind::UnknownProperty))
3752                    });
3753                }
3754            }
3755        }
3756        let field_id = raw_id
3757            .map(|value| {
3758                path.with("id", |path| {
3759                    let value = super::super::codec::expect_single(value, path)?;
3760                    super::primitives::checked_string(
3761                        super::super::codec::expect_string(value, path)?,
3762                        path,
3763                    )
3764                })
3765            })
3766            .transpose()?;
3767        let mut field_extension = Vec::new();
3768        if let Some(raw) = raw_extension {
3769            for (index, value) in path
3770                .with("extension", |path| {
3771                    super::super::codec::expect_array(raw, path)
3772                })?
3773                .iter()
3774                .enumerate()
3775            {
3776                field_extension.push(path.with_index("extension", index, |path| {
3777                    super::super::codec::Json::from_json(
3778                        super::super::codec::expect_object(value, path)?,
3779                        path,
3780                    )
3781                })?);
3782            }
3783        }
3784        let mut field_modifier_extension = Vec::new();
3785        if let Some(raw) = raw_modifier_extension {
3786            for (index, value) in path
3787                .with("modifierExtension", |path| {
3788                    super::super::codec::expect_array(raw, path)
3789                })?
3790                .iter()
3791                .enumerate()
3792            {
3793                field_modifier_extension.push(path.with_index(
3794                    "modifierExtension",
3795                    index,
3796                    |path| {
3797                        super::super::codec::Json::from_json(
3798                            super::super::codec::expect_object(value, path)?,
3799                            path,
3800                        )
3801                    },
3802                )?);
3803            }
3804        }
3805        let field_translations = path.with("translations", |path| {
3806            super::super::codec::Primitive::from_json_parts(
3807                raw_translations,
3808                raw_translations_element,
3809                path,
3810            )
3811        })?;
3812        Ok(Self {
3813            id: field_id,
3814            extension: field_extension,
3815            modifier_extension: field_modifier_extension,
3816            translations: field_translations,
3817        })
3818    }
3819}
3820
3821impl serde::Serialize for TerminologyCapabilitiesValidateCode {
3822    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3823        let mut map = serde::Serializer::serialize_map(serializer, None)?;
3824        super::super::codec::element_entry(&mut map, "_translations", &self.translations)?;
3825        if !self.extension.is_empty() {
3826            serde::ser::SerializeMap::serialize_entry(&mut map, "extension", &self.extension)?;
3827        }
3828        if let Some(v) = &self.id {
3829            serde::ser::SerializeMap::serialize_entry(&mut map, "id", v)?;
3830        }
3831        if !self.modifier_extension.is_empty() {
3832            serde::ser::SerializeMap::serialize_entry(
3833                &mut map,
3834                "modifierExtension",
3835                &self.modifier_extension,
3836            )?;
3837        }
3838        super::super::codec::value_entry(&mut map, "translations", &self.translations)?;
3839        serde::ser::SerializeMap::end(map)
3840    }
3841}
3842
3843impl<'de> serde::Deserialize<'de> for TerminologyCapabilitiesValidateCode {
3844    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3845        let value = <super::super::codec::Value as serde::Deserialize>::deserialize(deserializer)?;
3846        let mut path = super::super::codec::Path::root("TerminologyCapabilitiesValidateCode");
3847        let object =
3848            super::super::codec::expect_object(&value, &path).map_err(serde::de::Error::custom)?;
3849        super::super::codec::Json::from_json(object, &mut path).map_err(serde::de::Error::custom)
3850    }
3851}